shadcn.io is not affiliated with official shadcn/ui
Framework
UI library
Radix UI does not include this primitive, so this page uses the Ark UI component. The visuals match the Ark UI version.
Installation
bunx --bun shadcn@latest add https://kit.dev/r/radix/toggle-tooltip.jsonAnatomy
ToggleTooltipArrow
└── ToggleTooltipArrowTip
ToggleTooltipAnchor
ToggleTooltipTrigger
ToggleTooltipIndicator
ToggleTooltipContent
└── ToggleTooltipPositioner
ToggleTooltipTitle
ToggleTooltipDescription
ToggleTooltipCloseTriggerUsage
import { InfoIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
ToggleTooltip,
ToggleTooltipContent,
ToggleTooltipTrigger,
} from "@/components/ui/toggle-tooltip";<ToggleTooltip>
<ToggleTooltipTrigger asChild>
<Button aria-label="More information" size="icon-md" variant="outline">
<InfoIcon />
</Button>
</ToggleTooltipTrigger>
<ToggleTooltipContent className="max-w-52">
Hover or click to see this content. Works on touch devices too.
</ToggleTooltipContent>
</ToggleTooltip>Accessibility
| Key | Description |
|---|---|
Enter | Activate the focused control. |
Space | Activate the focused control. |
Demos
Info Icon
Side
With Link
API Reference
ToggleTooltip
PropType
children?ReactNodeAttributeType
ToggleTooltipArrow
div
PropType
AttributeType
CSS variableType
--foregroundstring--spacingstringToggleTooltipArrowTip
div
PropType
AttributeType
CSS variableType
--foregroundstring--spacingstringToggleTooltipTrigger
button
PropType
AttributeType
ToggleTooltipPositioner
div
PropType
AttributeType
CSS variableType
--transform-originstringToggleTooltipContent
div
PropType
AttributeType
CSS variableType
--transform-originstring