When the trigger is an interactive control, use triggerChild and spread the received props onto it so no extra wrapper button is created. children is for non-interactive content such as text, which the tooltip wraps in its own button. Tooltips open on keyboard focus too, but never put essential information only in a tooltip, because touch devices have no hover.
<script lang="ts">
import { Tooltip } from '@codeatlasdev/ui';
</script>
<p>
Static text can be a trigger too:
<Tooltip content="Wrapped in the tooltip's own button">hover or focus this text</Tooltip>
</p>
<style>
p { margin: 0; font-size: var(--ca-font-size-body2); color: var(--ca-text-secondary); }
</style>
Props
Prop
Type
Default
Description
content
string
–
Text shown in the tooltip. Required.
side
'top' | 'bottom' | 'left' | 'right'
'top'
Preferred placement side.
delay
number
500
Open delay in milliseconds.
class
string
''
Extra classes on the tooltip content.
children
Snippet
undefined
Non-interactive trigger content, wrapped in the tooltip's own button.
triggerChild
Snippet<[props]>
undefined
Interactive trigger. Receives the trigger `props` to spread onto a Button or IconButton.