Components
Tooltip
src/lib/components/ui/tooltip/
Purpose
Tooltip primitives. The barrel re-exports Root, Trigger, Provider from
bits-ui (via $lib/vendor/bits-ui-tooltip-exports to dodge a Vite 8 SSR
namespace issue) and adds two Primebrick extensions:
Content(tooltip-content.svelte) — the standard shadcn-svelte™ tooltip content with Primebrick styling.PriorityContent(priority-tooltip-content.svelte) — tooltip content with a semaphoric icon and optional title.priority(INFORMATION | WARNING | ERROR | QUESTION | HINT | SUCCESS) selects the icon and color (text-info,text-warning,text-destructive,text-success).TooltipPortal(tooltip-portal.svelte) — portal wrapper used byPriorityContent.
Origin
shadcn-svelte™ (extended) — base primitives come from bits-ui /
shadcn-svelte™. PriorityContent and the project-specific Content styling
are Primebrick additions.
Usage
Plain tooltip
Code
Trigger as a child snippet
Code
Priority tooltip — warning with title
Code
Priority tooltip — hint
Code
Props
Full prop table: see API reference — tooltip.
Key props:
Content — accepts ContentProps from bits-ui plus standard styling props (class, ref, sideOffset).
PriorityContent — extends ContentProps with:
priority(TooltipPriority, default"INFORMATION") — one ofINFORMATION | WARNING | ERROR | QUESTION | HINT | SUCCESS. Selects the leading icon and its semaphoric color.title(string) — optional bold heading rendered above the body. When omitted, only the icon is shown next to the body.children(Snippet, required) — tooltip body.
The exported TooltipPriority type is re-exported from the barrel.
Next steps
Last modified on