Agentic Design System
v3.5.0

Components · Actions · Action Swap

Back to Action Swap

Action SwapNew

Owner: Design System Team · Version: v3.5.0

Use for one control that cycles through related states - Follow/Following, Send/Sent - with a working phase and in-place failure.

Properties

Size, corner radius and the content options below are properties of the same component, not separate elements - change them to check this component's appearances and states in the Live Preview.

Live Preview

Every appearance side by side, each in every state. One full matrix is rendered per selected Size and Corner radius combination.

When to use

One control that cycles through related states.

Follow toggle Send invite Subscribe Save and confirm

Component Guide

Overview

Action Swap swaps an action label while preserving its place and intent. Each press runs the async action, shows a working phase, then commits to the next state or shows a failure message.

When to Use

  • One control that cycles through related states.
  • Toggles that run async work and need a working phase.
  • Short confirmations that revert on their own.

When Not to Use

  • A single save with a success tick - use a plain Button.
  • A label that never changes - use Button.
  • A light/dark toggle - use Switch.

Best Practices

  • Keep states few and labels short and similar in length.
  • Put the async work in the action and return its promise.
  • Customise the failure label for the context.

Accessibility

  • Native button whose label always matches what is visible.
  • Working sets aria-busy and aria-disabled so focus stays put.
  • A polite status announces each new label and failure.

Related Components

Button, Copy Button, Switch.