A short label on hover and keyboard focus, for icon buttons and cut-off text.
import { Tooltip } from "kivu-ui"On this page
import { Tooltip } from "kivu-ui";import { Button, IconButton, Tooltip } from "kivu-ui";
const Download = (
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M8 2.5v8M4.5 7 8 10.5 11.5 7M2.5 13.5h11" />
</svg>
);
export default function Demo() {
return (
<div className="flex flex-wrap items-center gap-4">
<Tooltip content="Export as CSV">
<IconButton aria-label="Export" variant="outline" shape="square">{Download}</IconButton>
</Tooltip>
<Tooltip content="Shown on the right" side="right">
<Button variant="soft">Hover or focus me</Button>
</Tooltip>
</div>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
content | ReactNode | - | Required. The tooltip text. Keep it short. |
children | ReactElement | - | Required. One focusable element. |
side | "top" | "top" | "left" | "right" | "top" | Preferred side; flips when there isn't room. |
align | "start" | "center" | "end" | "center" | Alignment along the trigger. |
delay | number | 400 | Hover delay in ms. Focus shows it straight away. |
disabled | boolean | false | Don't show the tooltip. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-tooltip