ui
ui copied to clipboard
[Suggestion] Split button component
There is one one the main page of the front page. So it can certainly be done already by composing components.
https://ui.shadcn.com/examples/cards
For anyone coming to this issue, like I did, here's some code that'll do the trick:
<div className="flex items-center">
<Button variant="outline" className={'rounded-r-none'}>
Create file
</Button>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className={'rounded-l-none border-l-0 px-2'}>
<CaretDownIcon />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem>Create sheet</DropdownMenuItem>
<DropdownMenuItem>Create doc</DropdownMenuItem>
<DropdownMenuItem>Create thingy</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
It's essentially two buttons, side-by-side, with their borders and styles tweaked.
You can easily imagine extending this with an icon or tweaking the dropdown as you so please.
Thank you. Closed.