Actions
SplitButton
A primary action with related alternatives in an attached menu.
- The main button does the most common thing; the chevron opens alternatives.
- Keep the menu to 2–6 items. Don't hide the only way to do something important inside it.
When to use
One main action with a few close alternatives: “Save” + “Save as draft”, “Export CSV” + other formats.
Use something else
No obvious default → MenuButton. Alternatives are unrelated actions → separate Buttons or MenuButton.
Do
- Make the main half the most common choice.
- Keep the menu to 2–5 variations of the same action.
Don't
- Don't hide destructive actions in the split menu.
- Don't use it for navigation.
Props
| Prop | Type |
|---|---|
variant | 'primary' | 'secondary' |
size | 'sm' | 'md' | 'lg' |
items required | MenuItem[] |
onClick | () => void; menuLabel?: string; disabled?: boolean; children: React.ReactNode; onSelect?: (id: string) => void; className?: string |
Use
const { SplitButton } = window.Tessera;
const el = React.createElement(SplitButton, { /* props */ });