Tooltip
A tooltip that swells out of nothing above its trigger.
Installation#
$ pnpm dlx shadcn@latest add @liquikit/tooltipNeeds the @liquikit registry in your components.json. Set it up once.
Usage#
import { Tooltip } from "@/components/liquikit/tooltip"<Tooltip.Provider>
<Tooltip.Root>
<Tooltip.Trigger icon aria-label="Share">…</Tooltip.Trigger>
<Tooltip.Popup>Share</Tooltip.Popup>
</Tooltip.Root>
</Tooltip.Provider>Tooltip.Provider lets tooltips next to each other open instantly once one has opened. Tooltip.Trigger is a glass button.
API Reference#
Tooltip.Root
| Prop | Type | Default |
|---|---|---|
open | booleanWhether the popup is open. Pair it with | — |
Also takes every prop of Base UI's tooltip, plus className and style.
Tooltip.Popup
| Prop | Type | Default |
|---|---|---|
side | BaseTooltip.Positioner.Props["side"]Which side of the trigger the popup opens on. | "top" |
sideOffset | numberGap between the trigger and the popup, in pixels. | 8 |
theme | "light" | "dark"Light or dark glass. Falls back to the nearest | — |
refraction | "interactive" | "always"When the glass bends the page. | "interactive" |
children | ReactNodeThe content. | — |
Also takes every prop of Base UI's tooltip, plus className and style.