kits-core
Version:
Kits core module
32 lines (24 loc) • 1.59 kB
Markdown
# PToolTip
A simple text popup tip.
## When To Use
- The tip is shown on mouse enter, and is hidden on mouse leave. The Tooltip doesn't support complex text or operations.
- To provide an explanation of a button/text/operation. It's often used instead of the html title attribute.
## How to use
- Import
```
import PTooltip from 'components/p-elements/tooltip/PTooltip';
```
- Examples
```
<PTooltip placement="right" title={data.name}>
<div className={`${block__elem}-name ${active ? 'active' : ''}`}>{data.name}</div>
</PTooltip>
```
## API
|Property |Description |Type |Default Value |
|--- |--- |--- |--- |
|placement |The position of the tooltip relative to the target, which can be one of `top`|`left`|`top`|`left`|`right`|`bottom`|`topLeft`|`topRight`|`bottomLeft`|`bottomRight`|`leftTop`|`leftBottom`|`rightTop`|`rightBottom`|string |`top` |- |
|title |The text shown in the tooltip |ReactNode | () => ReactNode |- |
|isAlwaysDisplayed |If `true` tooltip will be always show when trigger |`boolean` |false |
## Notes
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.