pnpm dlx shadcn@latest add @saturation-ui/split-buttonTailwind v4 — Source Scanning
The public shadcn registry installs component source into your project. If Tailwind v4 isn't scanning your components directory, add this to your CSS entry file:
@source "../components";This ensures all utility classes in CVA variants and data attribute selectors are included in your build.
import { SplitButton } from "@/components/ui/split-button"<SplitButton onClick={addLine} dropdownContent={<DropdownMenuItem>New phase</DropdownMenuItem>}>
Add line
</SplitButton>| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "secondary" | "outline" | "destructive" | "default" | Visual variant applied to both segments. |
size | "default" | "sm" | "xs" | "lg" | "default" | Height and padding scale. |
onClick | () => void | — | Handler for the primary (left) action. |
dropdownContent | React.ReactNode | — | DropdownMenu items rendered when the chevron segment is opened. |
dropdownAlign | "start" | "center" | "end" | "end" | Dropdown alignment relative to the trigger. |
icon | React.ReactNode | — | Optional leading icon for the primary action. |
shortcut | string | — | Keyboard shortcut chip rendered after the label. |
stretch | boolean | — | Stretch the primary segment to fill available width; the chevron stays fixed. |
color | string | — | Custom background color overriding the variant (hover handled consistently). |
disabled | boolean | — | Disables both segments. |
On This Page