Tooltip
The tooltip component, at a minimum, has a container, a pointer arrow, and a message. A button icon pointer, badge, image and close button can also be added.
Type | Resource |
---|---|
Design | Figma |
Web | Web Storybook |
Code | Gitlab |
Click Me!
Usage
import { Tooltip } from 'bio-bind-ui';
<Tooltip
delay={200}
event='hover'
id='tooltip'
mode='light'
placement='top-center'
showArrow
textSize='sm'
/>
Examples
TextSize
To modify the text size in a tooltip component UI: xs
, sm
, md
, lg
, xl
, 2xl
Text XS
Text SM
Text MD
Text LG
Text XL
Text 2XL
Mode (Optional)
Use mode for change color mode of tooltip component: light
or dark
Light
Dark
Props
Props | Required | Default | Type | Description |
---|---|---|---|---|
text | false | - | React.ReactNode | The text content of the tooltip, which can be any valid React node. |
showArrow | false | true | boolean | Indicates whether to show the arrow in the tooltip. |
placement | false | top-center | top-start , top-center , top-end , right-start , right-center , right-end , bottom-start , bottom-center , bottom-end , left-start , left-center , left-end | The placement of the tooltip relative to the target element. |
mode | false | light | dark , light | The mode of the tooltip, either dark or light. |
id | true | - | string | The unique identifier for the tooltip component, useful for accessibility or targeting specific elements. |
event | true | hover | hover , click | The event that triggers the tooltip display, either hover or click . |
textSize | false | md | xs , sm , md , lg , xl , 2xl | The text size of the tooltip. |
showCloseIcon | false | false | boolean | Indicates whether to show a close icon in the tooltip. |
delay | false | 200 | number | The delay (in milliseconds) before the tooltip appears or disappears. |
image | false | - | <HTMLImageElement> | The image to be displayed in the tooltip, if applicable. |
style | false | {} | React.CSSProperties | The custom styles for the tooltip component. |
className | false | - | string | The class name of the tooltip component for styling. |