Expanding Action Component

A compact action that transforms in place into a short set of related choices without opening a separate menu.

Features

  • Shared-surface motion preserves context between the trigger and its choices.
  • Controlled and uncontrolled expanded state.
  • Native button semantics with visible keyboard focus states.
  • User-configured reduced-motion behavior through Motion.
  • Disabled actions and individual disabled choices.
  • Horizontal overflow for narrow containers and longer labels.

Playground

Change the trigger label, initial state, and disabled behavior, then try the interaction with pointer and keyboard input.

Controls
Controls

Installation

Usage

Props

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.