#159
Icon trigger
A dropdown menu opened by a three-dot icon button, with Share and Copy link items aligned to the end.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Icon trigger" pattern (@codeatlasdev/ui demo #159, navigation/menu) in my app.
Call get_demo({ ids: ["#159"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Compact overflow menus on cards and table rows where a full button would take too much space.
Keep these library parts, with the props and tokens the demo uses:
- DropdownMenu, DropdownMenuItem, DropdownMenuLabel, IconButton from "@codeatlasdev/ui"
Behaviour to keep:
- `<DropdownMenu align="end">`
- `{#snippet triggerChild(props)}` renders `<IconButton aria-label="More options" {...props}>` with `<MoreHorizontal size={18} />`
- `<DropdownMenuLabel>Actions</DropdownMenuLabel>` then 2 items: Share and Copy link
- Item content is passed with `{#snippet children()}` using `<Share2 size={14} />` and `<Copy size={14} />`
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
- DropdownMenu
@codeatlasdev/ui - DropdownMenuItem
@codeatlasdev/ui - DropdownMenuLabel
@codeatlasdev/ui - IconButton
@codeatlasdev/ui
How it is built
- `<DropdownMenu align="end">`
- `{#snippet triggerChild(props)}` renders `<IconButton aria-label="More options" {...props}>` with `<MoreHorizontal size={18} />`
- `<DropdownMenuLabel>Actions</DropdownMenuLabel>` then 2 items: Share and Copy link
- Item content is passed with `{#snippet children()}` using `<Share2 size={14} />` and `<Copy size={14} />`
Related
Loading source.