react-img-map-area

1.0.0 • Public • Published

React Image Map Area

A react custom hook that makes HTML Image Maps responsive, automatically stay scaled to the size of the image they are attached to. It detects the window being resized and updates the co-ordinates of the image map accordingly.

Usage

import useImgMapArea from 'react-img-map-area'

export default function MyComponent() {

  useImgMapArea()

  return (
    <>
      <img src='...' useMap='#myMap'/>
      <map name='myMap'></map>
    </>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-img-map-area

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.79 kB

Total Files

3

Last publish

Collaborators

  • siowhaozhen