Tooltip
Short hint on hover or focus.
Import
tsx
import { Tooltip } from "@cronus-ui/ui";
bash
npx cronus-ui add tooltip
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component TooltipDefault layout:inline style:tooltip {
label "Need help?"
text "We usually reply within minutes."
}
page "/audit/tooltip/default" type:custom {
use TooltipDefault
}
API Reference
Generated from the component's exported types.
TooltipProviderProps
Extends ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>
| Prop | Type | Default | Description |
|---|---|---|---|
delayDuration | number | — | Default open delay for nested tooltips. |
skipDelayDuration | number | — | Grace period when moving between tooltips. |
disableHoverableContent | boolean | — | — |
TooltipProps
Extends ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. |
defaultOpen | boolean | — | Uncontrolled initial open state. |
onOpenChange | (open: boolean) => void | — | Called when the open state changes. |
children | ReactNode | — | Contents of the component. |
delayDuration | number | — | — |
disableHoverableContent | boolean | — | — |
TooltipTriggerProps
Extends ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
TooltipContentProps
Extends ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
| Prop | Type | Default | Description |
|---|---|---|---|
side | "top" | "right" | "bottom" | "left" | — | Preferred side of the trigger. |
align | "start" | "center" | "end" | — | Alignment along the chosen side. |
sideOffset | number | — | Distance in pixels from the trigger. |
alignOffset | number | — | Offset along the alignment axis. |
forceMount | boolean | — | Keep the node mounted when closed, for exit animation. |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
aria-label | string | — | — |