react-france-regions-map
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

React France Regions Map

Demo

demo

Installation

npm i react-france-regions-map

Usage

See demo/App.tsx

<div
  style={{
    width: "100vw",
    height: "100vh",
    display: "flex",
    flexDirection: "column",
    alignItems: "center",
  }}
>
  <FranceMap
    initialSelection={selectedRegions}
    onChange={(regions) => {
      console.log(regions);
      setSelectedRegions(regions);
    }}
    style={{ flex: 1, width: "100%" }}
    map="france-drom"
    colors={{
      default: {
        color: "#4f34eb",
        fillColor: "#4f34eb",
        weight: 1,
      },
      hover: {
        color: "#23badb",
        fillColor: "#23badb",
        weight: 2,
      },
      selected: {
        color: "#82db23",
        fillColor: "#82db23",
        weight: 2,
      },
    }}
  />
  <div>
    Régions sélectionnées :{" "}
    {selectedRegions.join(", ") || "Aucune région sélectionnée"}
  </div>
</div>

Run demo

git clone https://github.com/badwulfy/react-france-regions-map.git
cd react-france-regions-map
npm install
npm run demo

Package Sidebar

Install

npm i react-france-regions-map

Weekly Downloads

8

Version

0.2.3

License

none

Unpacked Size

111 kB

Total Files

9

Last publish

Collaborators

  • badwulfy