https://github.com/afeiship/react-tip
Tooltip for react based on ballon.css.
https://github.com/afeiship/react-tip
balloon react tip tooltip
Last synced: about 2 months ago
JSON representation
Tooltip for react based on ballon.css.
- Host: GitHub
- URL: https://github.com/afeiship/react-tip
- Owner: afeiship
- License: mit
- Created: 2020-01-27T12:42:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-26T10:40:48.000Z (over 5 years ago)
- Last Synced: 2025-03-17T22:55:50.315Z (over 1 year ago)
- Topics: balloon, react, tip, tooltip
- Language: JavaScript
- Size: 116 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# react-tip
> Tooltip for react based on ballon.css.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```shell
npm install -S @jswork/react-tip
```
## properties
| Name | Type | Required | Default | Description |
| --------- | ------ | -------- | ------- | ------------------------------------- |
| className | string | false | - | The extended className for component. |
| title | string | false | - | The tooltip title. |
| placement | enum | false | 'up' | The placement. |
## usage
1. import css
```scss
// or use sass
@import "balloon-css";
@import "~@jswork/react-tip/dist/style.scss";
// customize your styles:
$react-tip-options: ()
```
2. import js
```js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTip from '@jswork/react-tip';
import './assets/style.scss';
class App extends React.Component {
state = {
placements: [
'up',
'down',
'left',
'right',
'up-left',
'up-right',
'down-left',
'down-right'
]
};
render() {
const { placements } = this.state;
return (
{placements.map((item) => {
return (
Abc.com - {item}
);
})}
);
}
}
ReactDOM.render(, document.getElementById('app'));
```
## documentation
- https://afeiship.github.io/react-tip/
## license
Code released under [the MIT license](https://github.com/afeiship/react-tip/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/react-tip
[version-url]: https://npmjs.org/package/@jswork/react-tip
[license-image]: https://img.shields.io/npm/l/@jswork/react-tip
[license-url]: https://github.com/afeiship/react-tip/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-tip
[size-url]: https://github.com/afeiship/react-tip/blob/master/dist/react-tip.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/react-tip
[download-url]: https://www.npmjs.com/package/@jswork/react-tip