An open API service indexing awesome lists of open source software.

https://github.com/marlo22/react-sticky-mouse-tooltip

React tooltip component that follow mouse cursor.
https://github.com/marlo22/react-sticky-mouse-tooltip

component cursor fixed follow mouse popover react sticky tooltip

Last synced: 4 months ago
JSON representation

React tooltip component that follow mouse cursor.

Awesome Lists containing this project

README

          

# react-sticky-mouse-tooltip
React tooltip component that follow mouse cursor. You can pass as children any HTML element or other React component.


Component functionality preview

## Installation
`npm install react-sticky-mouse-tooltip --save`

or

`yarn add react-sticky-mouse-tooltip`

## Example
```js
import React from 'react';
import MouseTooltip from 'react-sticky-mouse-tooltip';

class Preview extends React.Component {
state = {
isMouseTooltipVisible: false,
};

toggleMouseTooltip = () => {
this.setState(prevState => ({ isMouseTooltipVisible: !prevState.isMouseTooltipVisible }));
};

render() {
return (



Toggle mouse tooltip


Follow the cursor!


);
}
}
```

## Attributes
| Attribute | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| visible | Visibility of component. | ```boolean``` | No | ```true``` |
| offsetX | Offset along X axis. | ```number``` | No | ```0``` |
| offsetY | Offset along Y axis. | ```number``` | No | ```0``` |
| className | Tooltip ```div``` class name. | ```string``` | No | - |
| style | Styles properties of tooltip ```div```. | ```object``` | No | - |

## License
MIT