Expanding Action

Use Expanding Action when one compact control reveals a short set of related choices in the same place. The trigger and choices share one surface, so the interaction remains connected to its source.

Preview

Reduce motion:Off
Tune:Off
Inspect

Installation

Basic usage

TypeScript
share-action.tsx

Examples

Use controlled open state when another control needs to manage the expanded choices. Keep labels short, and use disabled items only when an option cannot be performed.

Usage

API

PropertyTypeDefaultDescription
itemsExpandingActionItem[]requiredShort choices revealed when the action expands.
triggerReactNoderequiredContent displayed inside the collapsed trigger.
triggerIconReactNodeundefinedOptional icon displayed before the trigger content.
openbooleanundefinedControlled expanded state.
defaultOpenbooleanfalseInitial expanded state for uncontrolled usage.
onOpenChange(open: boolean) => voidundefinedCalled whenever the expanded state changes.
onValueSelect(value: string) => voidundefinedCalled with the selected item value before the action collapses.
backLabelstring"Back"Accessible label for the control that returns to the trigger.
disabledbooleanfalseWhether the trigger and choices are unavailable.
classNamestringundefinedAdditional classes for the rendered state container.
triggerClassNamestringundefinedAdditional classes for the collapsed trigger.
optionClassNamestringundefinedAdditional classes applied to every choice button.

Accessibility

The trigger and choices use button semantics with keyboard focus states. Make each choice label specific enough to describe the resulting action.

Styling

The component supports narrow containers and long labels through horizontal overflow. Reduced-motion preferences remove the expansion travel.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.

Related components