0.0.1 • Published 5 years ago
react-map-brazil-test v0.0.1
react-map-brazil
Accessible Brazil map component for React.JS
Table of Contents
Installation
To install, you can use npm:
$ npm install --save react-map-brazil
Examples
This is an example that shows the map of Brazil on the screen with the default styles:
import React, { useState } from 'react'
import ReactDOM from 'react-dom'
function App () {
const [district, setDistrict] = useState('')
return (
<>
<MapBrazil onChange={(e) => setDistrict(e)} />
<p>The selected district was {district}</p>
</>
)
}
Pass a width and height style to the map:
import React from 'react'
function App () {
return <MapBrazil width={300} height={300} />
}
Customize the background color and state color when selecting the district:
import React from 'react'
import ReactDOM from 'react-dom'
function App () {
return <MapBrazil width={300} height={300} fill='#000' bg='#fff' colorLabel='red' />
}
Change the color of the map outline
import React from 'react'
import ReactDOM from 'react-dom'
function App () {
return <MapBrazil colorStroke='#000' />
}