Skip to main content

Tooltip

The TkTooltip is used to display additional information when element is hovered over.

import { TkTooltip } from '@takeoff-ui/react'

Variants​

Provides 7 different variants dark, white, info, success, danger, warning, neutral via variant property.







View Code
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="white"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="info"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="success"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="danger"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="warning"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="neutral"
>
<TkButton slot="trigger" label="Hover Me!"></TkButton>
</TkTooltip>

Position​

Establishes 12 different placement position top-start, top, top-end, right-start, right, right-end, bottom-start, bottom, bottom-end, left-start, left, left-end via position property.

View Code
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="top-start"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Top Start" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="top"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Top" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="top-end"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Top End" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right-start"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Right Start" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Right" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="right-end"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Right End" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="left-start"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Left Start" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="left"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Left" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="left-end"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Left End" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="bottom-start"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Bottom Start" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="bottom"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Bottom" />
</TkTooltip>
<TkTooltip
header="Tooltip Header"
description="Tooltip Explanation Here"
position="bottom-end"
icon="flight"
variant="dark"
>
<TkButton slot="trigger" label="Bottom End" />
</TkTooltip>

Tooltip API​

Props​

NameTypeDefaultDescription
anynullThe style attribute of container element
stringnullSets description text for the tooltip.
stringnullSets header text for the tooltip.
IIconOptions, IMultiIconOptions, stringnullSpecifies a material icon name to be displayed.
"bottom", "bottom-end", "bottom-start", "left", "left-end", "left-start", "right", "right-end", "right-start", "top", "top-end", "top-start"'right'Sets the position of the tooltip.
"danger", "dark", "info", "neutral", "success", "warning", "white"'neutral'Sets the color variant of the tooltip.

Slots​

NameDescription
contentDefine custom HTML content for the tooltip, which replaces the default header, description and icon elements
triggerThe trigger slot defines the element that will trigger the tooltip