Action Button & Split Trigger
Action buttons trigger immediate commands, form submissions, and asynchronous deployments. Pair a primary trigger with an attached split menu when a surface exposes secondary commit modes without competing for focal attention.
import { ActionButton } from "@solstice-ui/action-button";Interactive playground
Test emphasis variants, density scales, loading transitions, and split-trigger composition directly. The generated JSX below stays synchronized with every control.
solid · md · accentClick the specimen button to verify interactive press feedback.
<ActionButton
variant="solid"
tone="accent"
leadingIcon={<RocketLaunchIcon />}
onPress={handleDeploy}
>
Deploy release
</ActionButton>Emphasis & variants
Solstice structures action hierarchy across five surface weights. Use a single solid accent button to anchor the primary path, pair adjacent secondary tasks with surface or outline treatments, and step repetitive toolbar commands down to ghost.
Keep destructive actions out of the primary accent channel. When an irreversible command lives inside a toolbar, use outline with a destructive tone and escalate to solid only inside the final confirmation dialog.
Split trigger pattern
When 80% of users invoke one default command (such as publishing immediately) while power users occasionally need alternate schedules or targets, couple a primary button with an attached menu chevron instead of crowding the toolbar.
Keep both halves in the same visual weight and tone so they read as one compound control, while giving each half its own independent tab stop and accessible name.
Do & Don't guidelines
Compare recommended patterns against common failure modes across action hierarchy, label clarity, and asynchronous feedback.
Establish one clear focal action
Pair one solid primary commitment with muted surface and ghost siblings so readers immediately recognize the intended path.
Stack competing solid buttons
Placing multiple solid accent buttons side by side flattens hierarchy, adds visual noise, and slows down scanning.
Lead with concise verb + noun
Name the exact object being modified (“Archive project”) so users can confirm destructive outcomes without re-reading dialog copy.
Use vague or sentence-length labels
Generic “OK” labels obscure consequences, while full sentences truncate awkwardly in localized and compact layouts.
Keep width & status text stable
Pair an inline spinner with present-participle copy so layout geometry stays steady and screen readers announce progress.
Collapse the label into a bare spinner
Replacing the text with an unguarded spinner causes horizontal toolbar jump and allows accidental double submissions.
API & props
All native HTMLButtonElement attributes pass through cleanly. Style overrides accept compiled StyleX objects via style and semantic color themes via palette.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "solid" | "surface" | "outline" | "subtle" | "ghost" | "surface" | Controls surface prominence. Reserve solid for a single primary commitment per view or dialog. |
size | "xs" | "sm" | "md" | "lg" | "md" | Sets control height, horizontal padding, and icon scale using Solstice spacing tokens. |
tone | "accent" | "neutral" | "destructive" | "neutral" | Applies semantic color intent. Pair destructive with confirmation dialogs for irreversible actions. |
loading | boolean | false | Displays an inline Spinner, sets aria-busy, and blocks duplicate submissions while preserving button width. |
loadingText | string | undefined | Optional status label announced to screen readers and shown beside the spinner while loading. |
disabled | boolean | false | Prevents activation and reduces contrast. Avoid disabling without explaining why the action is unavailable. |
leadingIcon | ReactNode | undefined | Decorative 16px SVG icon rendered before the label with aria-hidden applied automatically. |
splitMenu | boolean | false | Attaches a secondary chevron menu trigger sharing height, border radius, and tone for alternate commit modes. |
onPressRequired | () => void | Promise<void> | undefined | Activation handler. Returning a Promise automatically enters the pending state until settled. |
render | ReactElement | <button /> | Replaces the host element (for example, an anchor tag) while preserving focus ring and keyboard semantics. |
aria-label | string | undefined | Required for icon-only buttons and split menu triggers so assistive technologies announce an explicit verb. |
Usage recipes
Drop-in implementation snippets covering async Promise commits, split trigger menus, anchor element composition, and package installation.
import { ActionButton } from "@solstice-ui/action-button";
export function DeployButton({ onDeploy }: { onDeploy: () => Promise<void> }) {
return (
<ActionButton
variant="solid"
tone="accent"
size="md"
loadingText="Deploying release…"
onPress={onDeploy}
>
Deploy release
</ActionButton>
);
}Keyboard & ARIA contract
Action Button conforms to the WAI-ARIA Button and Menu Button patterns with a high-contrast 2px offset focus ring visible across both light and dark surfaces.
disabled removes a button from the tab sequence and can drop screen-reader focus to the document body. During short network requests, prefer aria-disabled="true" with aria-busy="true".| Key | Expected behavior | Scope |
|---|---|---|
| Tab | Moves keyboard focus to the primary button, then to the attached split menu trigger. | Global focus ring |
| Shift+Tab | Moves focus backward across the button group without trapping navigation. | Global focus ring |
| Enter | Activates the focused button immediately or submits the enclosing form. | Primary & split trigger |
| Space | Activates on key release, matching native button behavior and preventing page scroll. | Primary & split trigger |
| ArrowDown | Opens the attached split menu and moves focus directly to the first menu item. | Split trigger only |
| Esc | Dismisses an open split menu and restores focus cleanly to the chevron trigger. | Open split menu |
type="button"Defaults to non-submitting inside forms unless explicitly declared as submit.
aria-busy="true"Applied automatically during loading states alongside a polite live-region update.
aria-haspopup="menu"Paired with aria-expanded on the split trigger chevron to describe the attached menu.
aria-disabled="true"Prefer over native disabled during async commits so focus stays anchored on the control.
















