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 React, Base UI does not run the menu items.
Installation
Anatomy

Usage
<InputGroup className="w-full max-w-sm bg-background">
<InputGroupInput
aria-label="File name"
placeholder="Enter file name"
type="text"
/>
<InputGroupAddon align="inline-end">
<DropdownMenu>
<DropdownMenuTrigger
render={
<InputGroupButton
aria-label="More"
size="icon-xs"
variant="ghost"
/>
}
>
<MoreHorizontalIcon aria-hidden="true" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuGroup>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>Copy path</DropdownMenuItem>
<DropdownMenuItem>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 renders the InputGroupButton through render.
Why does the menu line up with the end of the field?
align="end" on DropdownMenuContent place it.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", aria-label="More" and size="icon-xs". The rest is on the Input Group page.
Dropdown Menu
Sets align="end". The rest is on the Dropdown Menu page.



