shadcn.io is an independent project built on shadcn/ui
A file name field with a ghost More button at the end. The menu lists Settings, Copy path, and Open location, lined up with the button's end. The items do not change the file name.
Use it when a field has extra actions that should not each be a button. If one of them cannot be undone, confirm it in an Alert Dialog. In Svelte, Ark UI does not run the menu items.
Installation
Anatomy

Usage
<InputGroup class="w-full max-w-sm bg-background"><InputGroupInput aria-label="File name" placeholder="Enter file name" type="text" /><InputGroupAddon align="inline-end"><DropdownMenu positioning={{ placement: "bottom-end" }}><DropdownMenuTrigger>{#snippet asChild(props)}<InputGroupButton {...props({ "aria-label": "More" })} size="icon-xs" variant="ghost"><MoreHorizontalIcon aria-hidden="true" /></InputGroupButton>{/snippet}</DropdownMenuTrigger><DropdownMenuContent><DropdownMenuGroup><DropdownMenuItem value="settings">Settings</DropdownMenuItem><DropdownMenuItem value="copy-path">Copy path</DropdownMenuItem><DropdownMenuItem value="open-location">Open location</DropdownMenuItem></DropdownMenuGroup></DropdownMenuContent></DropdownMenu></InputGroupAddon></InputGroup>FAQ
How is the More button wired to the menu?
The trigger is an icon-only InputGroupButton named More. DropdownMenuTrigger takes an asChild snippet that renders the InputGroupButton.
Why does the menu line up with the end of the field?
positioning on DropdownMenu sets placement to bottom-end.That keeps the menu under the button instead of spilling past the field.API Reference
Input Group
Sets aria-label="File name", placeholder="Enter file name", type="text", align="inline-end", props and aria-label. The rest is on the Input Group page.
Dropdown Menu
Sets positioning, placement, bottom-end, value="settings", value="copy-path" and value="open-location". The rest is on the Dropdown Menu page.



