Demo
Tooltip
Documented in Tooltip.
Tooltip
A formatting toolbar whose tooltips share one Tooltip.Provider delay, and a Delete button with a tooltip at the inline end.
Demo.tsx
'use client';
import { Button } from '@salmonui/buttons/button';
import { Tooltip } from '@salmonui/overlays/tooltip';
export default function TooltipDemo() {
return (
<div>
<div className="demo-toolbar">
<Tooltip.Provider delay={300}>
<Tooltip content="Bold (Ctrl+B)">
<Button aria-label="Bold" iconOnly variant="outline">
B
</Button>
</Tooltip>
<Tooltip content="Italic (Ctrl+I)">
<Button aria-label="Italic" iconOnly variant="outline">
I
</Button>
</Tooltip>
<Tooltip content="Underline (Ctrl+U)" placement="bottom">
<Button aria-label="Underline" iconOnly variant="outline">
U
</Button>
</Tooltip>
</Tooltip.Provider>
<Tooltip content="Removes the order permanently" placement="end" render={(props) => <Button {...props} tone="danger">Delete</Button>} />
</div>
</div>
);
}
Hover a button, then move along the toolbar: the next tooltip opens at once. Tab to a button to open its tooltip from the keyboard; Escape closes it.