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.

tsx
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.

tsx
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.

tsx
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.

tsx
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.

tsx
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

NameDescriptionDefault
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'
Every other prop of <button> is passed through to it. See MDN: <button>.

SplitButton.Icon

NameDescriptionDefault
icon*

Icon component rendered inside the button.

RemixiconComponentType
—
children—
className

Additional CSS classes merged onto the SVG icon.

string
—

SplitButton.TruncatedText

No props of its ownIt takes its content as children and nothing else.

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.
PartRendersDescription
SplitButton<button>A primary action with a separate dropdown trigger.
SplitButton.Icon—`SplitButton.Icon` is `Button.Icon`; same props.
SplitButton.TruncatedText—`SplitButton.TruncatedText` is `Button.TruncatedText`; same props.
tsx
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>

Appearance

Variant
Style
Size

State

Disabled
Menu disabled