0.0.13 • Published 3 years ago

@madup-inc/react-imagemarker v0.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-imagemarker

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save @madup-inc/react-imagemarker

Usage

import React from 'react'
import ImageMarker from '@madup-inc/react-imagemarker'
import '@madup-inc/react-imagemarker/dist/index.css'

const markers = [
  {
    x: 20,
    y: 40,
    id: 1,
  },
  {
    x: 40,
    y: 40,
    id: 2,
  },
  {
    x: 70,
    y: 55,
    id: 3,
    render: () => <div style={{ fontSize: 30 }}>🙂</div>,
  },
]

const App = () => {
  return (
    <div style={{ width: 500, height: 500 }}>
      <ImageMarker
        src="https://lever.me/statics/image/introduce/Group16.svg"
        markers={markers}
        onImageClick={({ x, y }, clickEvent, wrapperDom) => {
          console.log({ x, y, clickEvent, wrapperDom })
        }}
      />
    </div>
  )
}

export default App

Output 🙂

npm.io

License

MIT © Madup

0.0.12

3 years ago

0.0.13

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago