react-hexagon-grid
React component that renders a fully adaptable grid of flat-topped hexagons using SVG. The component fills the container with the hexagons, adapting their size properly.
Installation
react-hexagon-grid
can be installed using npm:
npm install --save react-hexagon-grid
Basic usage
;; const hexagons = ... /* Put your content here */; React;
See the demo for a working example.
Props
gridWidth
- The width, in pixel, of the grid (required)gridHeight
- The height, in pixel, of the grid (required)hexagons
- An array of hexagon objects (required)renderHexagonContent
- A function to render the content of each hexagonhexProps
- The props that will be assigned to each hexagon
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request