react-brazil-map-2
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-brazil-map · npm version

Accessible Brazil map component for React.JS

Table of Contents

Installation

To install, you can use npm:

$ npm install --save react-brazil-map

To install, you can use yarn:

$ yarn add react-brazil-map

Examples

Example of district selection and default style:

import React, { useState } from 'react'
import { MapBrazil } from 'react-brazil-map'

function App () {
  const [district, setDistrict] = useState('')
  return (
    <div className='App'>
      <MapBrazil onChange={setDistrict} />
      <p>The selected district was {district}</p>
    </div>
  )
}

Customize the background color, selection color and map outline:

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:

import React from 'react'
import { MapBrazil } from 'react-brazil-map'

function App () {
  return (
    <div className='App'>
      <MapBrazil colorLabel='red' width={500} height={500} />
    </div>
  )
}

Package Sidebar

Install

npm i react-brazil-map-2

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.74 kB

Total Files

2

Last publish

Collaborators

  • hylansilva