Split Button
Pair a primary action with a menu of related actions.
Preview
Import
import { SplitButton } from "@sigil-ui/components";Usage
"use client";
import { useState } from "react";
import { SplitButton } from "@sigil-ui/components";
function SplitButtonPreview() {
const [message, setMessage] = useState("Choose an action.");
return <div className="grid gap-[var(--s-space-16)] w-full">
<div><SplitButton onClick={() => setMessage("Project saved.")} onDropdownClick={() => setMessage("Save a copy selected.")} dropdownLabel="Save a copy">Save project</SplitButton></div>
<p role="status" className="text-[var(--s-text-muted)] text-[length:var(--s-size-sm)]">{message}</p>
</div>;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children (required) | ReactNode | — | Content rendered inside the component. |
icon | ReactNode | — | Icon configuration. |
onDropdownClick | () => void | — | On Dropdown Click configuration. |
dropdownLabel | string | — | Dropdown Label configuration. |
Token integration
| CSS Variable | Purpose |
|---|---|
--s-radius-md | Radius md |
--s-border-style | Border style |
--s-border | Border |
--s-surface | Surface |
--s-text | Text |
--s-duration-fast | Duration fast |
--s-surface-elevated | Surface elevated |
--s-primary | Primary |
--s-text-muted | Text muted |