1.3.0 • Published 3 years ago

react-image-tooltips v1.3.0

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

react-image-tooltips

NPM version Minified size Minified + gzip size

React component that implements an image with tooltips (hot spots). May be useful for creating interactive images which user can click/tap on and see description of what is presented on the image.

DEMO

Install

react-spring is used for accordion animation so it's peer dependency that should be installed with react-image-tooltips.

npm install --save react-spring react-image-tooltips

Usage

import {ImageTooltips, ImageTooltipsItem, ImageTooltipsTrigger} from "react-image-tooltips";
import "react-image-tooltips/dist/index.css";

// ...

    const MyTrigger = (<ImageTooltipsTrigger className="my-trigger">
        +
    </ImageTooltipsTrigger>);
    
    <ImageTooltips src="example.jpg" width={816} height={544} className="my-image" triggerEvent="click">
        <ImageTooltipsItem top={226} left={301} trigger={MyTrigger} className="my-item">
            <p>Here's some content that lies inside an tooltip.</p>
            <p>This content can only be viewed, once the tooltip is toggled.</p>
        </ImageTooltipsItem>
        <ImageTooltipsItem top={300} left={504} trigger={MyTrigger} className="my-item">
            <p>Here's some content that lies inside an tooltip.</p>
            <p>This content can only be viewed, once the tooltip is toggled.</p>
        </ImageTooltipsItem>
    </ImageTooltips>

License

MIT © krasnoshapka

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago