Displays a button or a that looks like an icon.
Loading demo: button-split-real-world
npx sdaia-ui@latest add buttonsplit
import { Button } from '@/components/ui/Button';import { Button } from '@/components/ui/Button';Use the `size` prop to change the size of the button close.
Loading demo: button-split-sizes
The default button close style.
Loading demo: button-split-default
Props for the Button Split component.
Prop | Type | Default | Required |
|---|---|---|---|
label | string | — | optional |
variant | 'neutral' | 'primary' | 'secondary-solid' | 'secondary-outline' | 'subtle' | 'transparent' | 'neutral' | optional |
size | 'sm' | 'md' | 'lg' | 'md' | optional |
leadingIcon | ReactNode | — | optional |
onClick | MouseEventHandler | — | optional |
onMenuClick | MouseEventHandler | — | optional |
menuItems | ButtonSplitMenuItem[] | — | optional |
open | boolean | — | optional |
onOpenChange | (open: boolean) => void | — | optional |
menuAriaLabel | string | 'Open menu' | optional |
disabled | boolean | — | optional |
dir | 'ltr' | 'rtl' | — | optional |
className | string | — | optional |
mainButtonProps | ButtonHTMLAttributes | — | optional |
menuButtonProps | ButtonHTMLAttributes | — | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Sized by its label, never wider than its container. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | Same with the mobile token values. A long label is truncated so the arrow section stays visible. |