react-brazil-map
Version:
Component of the map of Brazil
68 lines (49 loc) • 1.31 kB
Markdown
Accessible Brazil map component for React.JS
- [Installation](
- [Examples](
To install, you can use [npm](https://npmjs.org/):
$ npm install --save react-brazil-map
To install, you can use [yarn](https://https://yarnpkg.com/):
$ yarn add react-brazil-map
Example of district selection and default style:
```jsx
import React, { useState } from 'react'
import { MapBrazil } from 'react-brazil-map'
function App () {
const [distritc, setDistrict] = useState('')
return (
<div className='App'>
<MapBrazil onChange={setDistrict} />
<p>The selected district was {distritc}</p>
</div>
)
}
```
Customize the background color, selection color and map outline:
```jsx
import React from 'react'
import { MapBrazil } from 'react-brazil-map'
function App () {
return (
<div className='App'>
<MapBrazil bg='#6edbdb' fill='#000' colorStroke='red' />
</div>
)
}
```
You can also pass a style for the district title, width and height of the map:
```jsx
import React from 'react'
import { MapBrazil } from 'react-brazil-map'
function App () {
return (
<div className='App'>
<MapBrazil colorLabel='red' width={500} height={500} />
</div>
)
}
```