Split Button
SplitButton is two independent interactive elements sharing a single visual unit: the left button triggers the primary action; the right icon button opens a dropdown menu.
import { RiArrowDownSLine } from '@remixicon/react';
import { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { SplitButton } from '@/components/ui/wideset/button/SplitButton';
<SplitButton
icon={RiArrowDownSLine}
menuContent={
<>
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Save as draft</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Schedule for later</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item variant="danger">
<ListItem.Content>
<ListItem.Label>Discard</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
</>
}
>
Publish
</SplitButton>Installation
pnpm dlx wideset add split-button
Copies the component and any Wideset components it uses into your project.
Examples
Variants
The label runs the most common action; the chevron opens a menu of related alternatives. The colours follow Button: primary for the main action, secondary for a supporting one, danger when the main action destroys something, success for a confirming one, inverse on dark or coloured surfaces.
import { RiArrowDownSLine } from '@remixicon/react';
import { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { SplitButton } from '@/components/ui/wideset/button/SplitButton';
const menu = (
<>
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Save as draft</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Schedule for later</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
</>
);
export default function SplitButtonVariants() {
return (
<div className="gap-ws-12 flex flex-wrap items-center">
<SplitButton variant="primary" icon={RiArrowDownSLine} menuContent={menu}>
Publish
</SplitButton>
<SplitButton variant="secondary" icon={RiArrowDownSLine} menuContent={menu}>
Export
</SplitButton>
<SplitButton variant="danger" icon={RiArrowDownSLine} menuContent={menu}>
Archive
</SplitButton>
<SplitButton variant="success" icon={RiArrowDownSLine} menuContent={menu}>
Approve
</SplitButton>
<div className="bg-ws-static-inverse-background rounded-ws-container-md p-ws-8">
<SplitButton variant="inverse" icon={RiArrowDownSLine} menuContent={menu}>
Share
</SplitButton>
</div>
</div>
);
}Presets
Filled gives the split action the full call-to-action weight; border keeps both halves visible with less emphasis, for a split button next to a filled one. There is no ghost preset: without a surface the two halves would not read as one control.
import { RiArrowDownSLine } from '@remixicon/react';
import { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { SplitButton } from '@/components/ui/wideset/button/SplitButton';
const menu = (
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Save as template</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
);
export default function SplitButtonPresets() {
return (
<div className="gap-ws-12 flex flex-wrap items-center">
{(['filled', 'border'] as const).map((preset) => (
<SplitButton key={preset} preset={preset} icon={RiArrowDownSLine} menuContent={menu}>
Save
</SplitButton>
))}
</div>
);
}Sizes
Medium is the default. Extra small and small fit toolbars and other dense layouts; large gives the split action more presence and bigger hit areas. Both halves always share the size.
import { RiArrowDownSLine } from '@remixicon/react';
import { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { SplitButton } from '@/components/ui/wideset/button/SplitButton';
const menu = (
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Save as template</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
);
export default function SplitButtonSizes() {
return (
<div className="gap-ws-12 flex flex-wrap items-center">
{(['xs', 'sm', 'md', 'lg'] as const).map((size) => (
<SplitButton key={size} size={size} icon={RiArrowDownSLine} menuContent={menu}>
Save
</SplitButton>
))}
</div>
);
}States
Each half can be disabled on its own. disabled turns off the main action while the menu still opens, for when only the default choice is unavailable; iconDisabled turns off the menu while the main action still works. Set both when nothing can be done right now. The chevron's accessible name defaults to "More options"; change it with iconAriaLabel.
import { RiArrowDownSLine } from '@remixicon/react';
import { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { SplitButton } from '@/components/ui/wideset/button/SplitButton';
const menu = (
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Schedule for later</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
);
export default function SplitButtonStates() {
return (
<div className="gap-ws-12 flex flex-wrap items-center">
<SplitButton icon={RiArrowDownSLine} menuContent={menu}>
Publish
</SplitButton>
<SplitButton icon={RiArrowDownSLine} menuContent={menu} disabled>
Publish
</SplitButton>
<SplitButton icon={RiArrowDownSLine} menuContent={menu} iconDisabled>
Publish
</SplitButton>
<SplitButton icon={RiArrowDownSLine} menuContent={menu} disabled iconDisabled>
Publish
</SplitButton>
</div>
);
}API reference
SplitButton
| Name | Description | Default |
|---|---|---|
icon* | Icon rendered in the trailing dropdown trigger segment. RemixiconComponentType | — |
children | Button label or custom content rendered in the main action area. ReactNode | — |
className | Additional CSS classes merged with the outer wrapper element. string | — |
defaultMotion | Turns the component's built-in animations on or off. When omitted, inherits the value from the nearest `MotionProvider`. boolean | true |
defaultOpen | Uncontrolled default open state for the dropdown. boolean | — |
disabled | Disables the main (left) button only. boolean | — |
iconAriaLabel | Accessible label for the icon button. string | 'More options' |
iconDisabled | Disables the icon/dropdown trigger button independently of the main button. boolean | — |
menuAlign | Alignment of the dropdown content relative to the trigger. 'center''end''start' | 'end' |
menuContent | Items or content rendered inside the dropdown menu. Use `DropdownMenu.Item`, `DropdownMenu.Label`, and `DropdownMenu.Separator` to compose the menu. ReactNode | — |
menuSide | Preferred side of the trigger to render the dropdown against. 'bottom''left''right''top' | 'bottom' |
onClick | Called when the user activates the main button. MouseEventHandler<HTMLButtonElement> | — |
onOpenChange | Called when the dropdown open state changes. ((open: boolean) => void) | — |
open | Controlled open state for the dropdown. boolean | — |
preset | 'border''filled' | 'filled' |
size | 'xs''sm''md''lg' | 'md' |
type | Native button type used for the main button. 'button''submit''reset' | 'button' |
variant | 'primary''secondary''danger''success''inverse' | 'primary' |
<button> is passed through to it. See MDN: <button>.SplitButton.Icon
| Name | Description | Default |
|---|---|---|
icon* | Icon component rendered inside the button. RemixiconComponentType | — |
children | | — |
className | Additional CSS classes merged onto the SVG icon. string | — |
SplitButton.TruncatedText
Accessibility
- The chevron is a separate button; its name comes from
iconAriaLabel. Change it when “More options” does not describe the menu (“More publish options”). - Menu keyboard behaviour comes from
DropdownMenu.
| Part | Renders | Description |
|---|---|---|
| SplitButtonRenders no element | <button> | A primary action with a separate dropdown trigger. |
| SplitButton.IconRenders no element | — | `SplitButton.Icon` is `Button.Icon`; same props. |
| SplitButton.TruncatedTextRenders no element | — | `SplitButton.TruncatedText` is `Button.TruncatedText`; same props. |
import { RiArrowDownSLine } from '@remixicon/react';
import { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { SplitButton } from '@/components/ui/wideset/button/SplitButton';
<SplitButton
icon={RiArrowDownSLine}
menuContent={
<>
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Save as draft</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
<DropdownMenu.Item>
<ListItem.Content>
<ListItem.Label>Schedule for later</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
<DropdownMenu.Separator />
<DropdownMenu.Item variant="danger">
<ListItem.Content>
<ListItem.Label>Discard</ListItem.Label>
</ListItem.Content>
</DropdownMenu.Item>
</>
}
>
Publish
</SplitButton>