The react-map-portugal-svg is a SVG map of Portugal that we can interact with some events.
npm install --save react-map-portugal-svg
# or
yarn add react-map-portugal-svgimport React, { useState } from 'react';
import { MapPortugalSvg } from 'react-map-portugal-svg'
function App() {
const [selected, setSelected] = useState([]);
return (
<>
{JSON.stringify(selected)} {/* 👈 The result */}
<MapPortugalSvg setSelected={setSelected}/>
</>
);
}
export default App;| Name | Type | Description | Default |
|---|---|---|---|
| mapColor | - | - | #FFFFFF |
| hoverCircle | - | - | #EF6060 |
| selectedColor | - | - | #000000 |
| width | - | - | 100% |
| multipleSelect | - | - | false |
| hoverBorderSize | - | - | 2 |
| setSelected | function (useState) | - |
MIT © Orivelton César