Skip to main content
Urbicon UI

Tooltip

Contextual hints that appear on hover or focus.

Playground

Helpful hint
Size Style variant
Show Delay (ms)
200
Hide Delay (ms)
100
<Tooltip
  label="Helpful hint"
  placement="top"
>
  <Button variant="outlined" size="sm">Hover me</Button>
</Tooltip>

01 Examples

Wrap the trigger element as the child and pass the hint text in label. The tooltip opens on hover or focus after showDelay (200 ms) and follows placement (default top, auto-flipping when clipped). Set disabled to suppress it, or turn off the arrow for a plain chip.

Formatting toolbar

Icon-only controls need a name. The tooltip carries the label and its keyboard shortcut, on hover or focus.
<Toolbar aria-label="Text formatting">
  <Tooltip label="Bold (⌘B)" size="sm">
    <Button variant="ghost" size="sm"><span class="font-bold">B</span></Button>
  </Tooltip>
  <Tooltip label="Italic (⌘I)" size="sm">
    <Button variant="ghost" size="sm"><span class="italic">I</span></Button>
  </Tooltip>
  <Tooltip label="Underline (⌘U)" size="sm">
    <Button variant="ghost" size="sm"><span class="underline">U</span></Button>
  </Tooltip>
  <Separator orientation="vertical" size="sm" />
  <Tooltip label="Strikethrough (⌘⇧X)" size="sm">
    <Button variant="ghost" size="sm"><span class="line-through">S</span></Button>
  </Tooltip>
</Toolbar>

Severity-matched tooltips

intent tints the tooltip to the state it reports, so the colour reinforces the message.
Operational API Gateway, 99.99% uptime over 30 days Degraded Auth Service, elevated latency since 14:20 UTC Incident Database, failover active, primary unreachable
{#each services as row (row.service)}
  <Tooltip label={row.detail} intent={row.intent} placement="bottom">
    <Badge variant="soft" intent={row.intent}>{row.status}</Badge>
  </Tooltip>
{/each}

Reveal truncated text

Wrap clipped text so the full value shows on hover.
  • Q4-roadmap-final-with-stakeholder-feedback-v3.pdf Q4-roadmap-final-with-stakeholder-feedback-v3.pdf 2.4 MB
  • design-system-token-migration-notes.md design-system-token-migration-notes.md 18 KB
  • customer-interview-transcripts-jan-2026.zip customer-interview-transcripts-jan-2026.zip 14.2 MB
<ul class="divide-border-subtle mx-auto w-full max-w-sm divide-y text-sm">
  {#each files as file (file.name)}
    <li class="flex items-center justify-between gap-3 py-2.5">
      <Tooltip label={file.name} placement="top-start" size="sm">
        <span class="text-text-primary block max-w-[14rem] truncate">{file.name}</span>
      </Tooltip>
      <span class="text-text-tertiary shrink-0 text-xs">{file.size}</span>
    </li>
  {/each}
</ul>

02 Customization

Frosted glass

Tint just the panel with class. It keeps the tooltip's radius tier, fade and layering. The arrow is turned off, since a translucent panel reads cleaner as a plain chip. Raw colours because glass has no token equivalent.
Frosted glass tooltip
<Tooltip
  label="Frosted glass tooltip"
  arrow={false}
  class="border border-white/20 bg-white/15 text-white shadow-[var(--blocks-shadow-lg)] backdrop-blur-xl"
>
  <Button
    class="border border-white/30 bg-white/10 text-white shadow-none backdrop-blur-sm hover:bg-white/20"
  >
    Hover for glass
  </Button>
</Tooltip>

This is one of five ways to restyle a block. See Customization for class, slotClasses, unstyled, preset and provider-level overrides.

03 Accessibility

Built-in ARIA

Renders with role="tooltip" and links the trigger to it through aria-describedby. Each instance gets a unique id automatically, so a screen reader reads the tooltip as the trigger's description.

Keyboard

Tooltips open on hover or focus and dismiss with Escape. The panel itself is never focusable. It only supplements the trigger's accessible description.

Timing

A showDelay (default 200 ms) keeps the tooltip from flashing as the pointer passes over the trigger. A hideDelay (default 100 ms) lets the pointer cross a small gap without dismissing it.

Reduced motion

The fade runs on the --blocks-tooltip-duration token, an alias of --blocks-duration-fast. Under prefers-reduced-motion, that token collapses to 1 ms, so the tooltip appears and hides without a visible fade.

Valid inside a paragraph

Trigger, panel and arrow are all <span>, so a tooltip is valid inside a paragraph, the position it is built for. Two things stay yours: the trigger's own content has to be phrasing-level too, and the trigger wrapper is inline-flex, so a multi-word trigger is atomic and will not wrap across lines the way surrounding text does.

04 API Reference

19 props
19 props 2 required
Prop
Type
Default
Description

05 Types

Local type definitions used by this component.

6 types
Name
Kind
Category
Used by
Description

06 Installation

Import

import { Tooltip } from '@urbicon-ui/blocks';