Tooltip
Hover/focus popup with descriptive text
Tooltip content
Accessibility
- Ensure the trigger, popup role, and focus return behavior all describe the same interaction model.
- Provide an obvious keyboard dismissal path and avoid putting essential actions in hover-only content.
- Keep the opening control labeled, ensure focus moves predictably on open and close, and expose the popup type truthfully.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Tooltip, Button } from '@dryui/ui';
</script>
<Tooltip.Root>
<Tooltip.Trigger>
<Button variant="ghost">Hover me</Button>
</Tooltip.Trigger>
<Tooltip.Content>Extra information</Tooltip.Content>
</Tooltip.Root> Import options
Root package
ts
import { Tooltip } from '@dryui/ui' Per-component subpath
ts
import { Tooltip } from '@dryui/ui/tooltip' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
Tooltip.Root | |||||
| openDelay | number | — | 700 | — | — |
| closeDelay | number | — | 300 | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Tooltip.Trigger | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Tooltip.Content | |||||
| placement | toptop-starttop-endbottombottom-startbottom-endleftleft-startleft-endrightright-startright-end | — | 'top' | — | — |
| offset | number | — | 8 | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |