uibrik

Split Button

Preview

Customize

Solid
Medium
End
Below
Radius12px
Stagger0.030s

Usage

import { SplitButton } from "@/components/uibrik/split-button/split-button";

<SplitButton />

Installation

npx shadcn@latest add https://uibrik.com/r/split-button.json
Adds the files to components/uibrik/split-button and installs @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/split-button.

Props

SplitButton
options
Type string[]
["Merge pull request","Squash and merge","Rebase and merge"]
Actions the main button can run.
variant
Type "solid" | "soft" | "outline"
"solid"
Primary, or a quieter look for secondary actions.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
align
Type "end" | "start"
"end"
Which edge of the button the menu lines up with.
side
Type "bottom" | "top"
"bottom"
Open the menu below the button, or above it (e.g. in a footer).
radius
Type number
12
Corner radius.
stagger
Type number
0.03
Delay between menu items as they unfold.
defaultIndex
Type number
0
Index of the option chosen at first.
onAction
Type (option: string, index: number) => void
–
Called with the chosen option when the main button is pressed.
onSelect
Type (option: string, index: number) => void
–
Called when a different option is chosen from the menu.
className
Type string
–
Classes for the wrapper.