shadcn.io is an independent project built on shadcn/ui
Two split buttons. Fork sits beside a chevron named More fork options, with Create a fork and View existing forks. Star sits beside a chevron named More star options, with Add to list and View starred. The items do nothing.
Use a split button when one action is the default and the rest are variations. The menu is a Dropdown Menu. In Solid, Ark UI does not run Fork or Star.
Installation
Anatomy

Usage
<div class="flex flex-col gap-4">
<ButtonGroup aria-label="Fork">
<Button variant="outline">
<GitForkIcon aria-hidden="true" data-icon="inline-start" />
Fork
</Button>
<Menu positioning={{
placement: "bottom-end"
}}>
<MenuTrigger asChild={props => <Button {...props({
"class": "px-2"
})} aria-label="More fork options" variant="outline">
<ChevronDownIcon aria-hidden="true" />
</Button>} />
<MenuContent>
<MenuItem value="create-fork">Create a fork</MenuItem>
<MenuItem value="view-forks">View existing forks</MenuItem>
</MenuContent>
</Menu>
</ButtonGroup>
<ButtonGroup aria-label="Star">
<Button variant="outline">
<StarIcon aria-hidden="true" data-icon="inline-start" />
Star
</Button>
<Menu positioning={{
placement: "bottom-end"
}}>
<MenuTrigger asChild={props => <Button {...props({
"class": "px-2"
})} aria-label="More star options" variant="outline">
{/* The rest of the file is under Installation. */}FAQ
How is the chevron joined to Fork?
Fork is a Button, and the chevron is a second outline Button that is the menu's trigger, both inside one ButtonGroup. MenuTrigger uses asChild so the trigger is that button.
What does each menu list?
Fork lists Create a fork and View existing forks. Star lists Add to list and View starred.
How does the menu line up with the chevron?
It opens below and aligned to the end. Menu sets positioning with the placement bottom-end.
How is the chevron button named?
With an aria-label, More fork options or More star options. The icon has aria-hidden="true".
Do the menu items do anything?
No. The items and the Fork and Star buttons have no handler. Put the action on the button or the item you want to run.
Which component opens the menu?
Dropdown Menu. ButtonGroup only shares the border between the main button and the trigger.
API Reference
Button Group
Sets aria-label="Fork" and aria-label="Star". The rest is on the Button Group page.
Button
Sets variant="outline", props, px-2, aria-label="More fork options" and aria-label="More star options". The rest is on the Button page.
Menu
Sets positioning, placement, bottom-end, asChild, props and value="create-fork". The rest is on the Menu page.




