#142
Text trigger
A Tooltip wrapping plain inline text, which becomes the hover and focus trigger.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Text trigger" pattern (@codeatlasdev/ui demo #142, display/tooltip) in my app.
Call get_demo({ ids: ["#142"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Adding a short explanation to a term or inline phrase without building a custom trigger.
Keep these library parts, with the props and tokens the demo uses:
- Tooltip from "@codeatlasdev/ui"
Behaviour to keep:
- `<Tooltip content="Wrapped in the tooltip's own button">` with plain text children
- Children text: hover or focus this text
- No trigger snippet, the tooltip renders its own trigger
- Placed inside a paragraph after the sentence Static text can be a trigger too:
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Tooltip
@codeatlasdev/ui
How it is built
- `<Tooltip content="Wrapped in the tooltip's own button">` with plain text children
- Children text: hover or focus this text
- No trigger snippet, the tooltip renders its own trigger
- Placed inside a paragraph after the sentence Static text can be a trigger too:
Related
Loading source.