Tooltip
Frondshortcut.Usage
The import, then a use to start from. Both copy as they are.
Import
import { Search } from "@/components/icons";import { Button } from "@/components/ui/button";import { Tooltip } from "@/components/ui/tooltip";Example
<Tooltip content="Search" shortcut={["mod", "K"]}> <Button variant="ghostMuted" size="iconSm" aria-label="Search"> <Search /> </Button></Tooltip>When to use
Use it for
- Name an icon-only control, or add a detail that doesn't fit: a full date, a truncated path.
- Pass
shortcutto show the keys beside the label. sidewhen the default placement covers what the person is reading.- It needs a
TooltipProviderabove it; the app shell has one.
Avoid
- Anything needed to finish the task. Tooltips don't show on touch, so put it on the page.
- Links or buttons inside a tooltip: use a
Popover.
Accessibility
Checks
- It opens on keyboard focus as well as hover.
- The trigger keeps its own
aria-label; the tooltip repeats it for sighted users.
API
Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.
Tooltip
Its stories don't declare
argTypes, so no props are listed. The variants show its states.Also exportsTOOLTIP_CONTENT_CLASSTooltipProviderTooltipTag
VariantsDefaultTopBottomLeftRightLongContentEmptyContentWithShortcutWithTaggedRow
Keep going
- Kbd, KbdShortcutKey caps.
modrenders ⌘ or Ctrl by platform.Frond - ButtonEvery clickable. Variants: default, outline, ghost, ghostMuted, destructive, destructiveOutline, link.Frond
- Dialog, Popover, DropdownMenuFloating surfaces on
bg-overlaywith one hairline andshadow-overlay.Fiddle
Accessibility
Fern supports accessibility standards out of the box.