UNPKG

kits-core

Version:
32 lines (24 loc) 1.59 kB
# 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`&#124;`left`&#124;`top`&#124;`left`&#124;`right`&#124;`bottom`&#124;`topLeft`&#124;`topRight`&#124;`bottomLeft`&#124;`bottomRight`&#124;`leftTop`&#124;`leftBottom`&#124;`rightTop`&#124;`rightBottom`|string |`top` |- | |title |The text shown in the tooltip |ReactNode &#124; () => 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.