v0.1 public beta early access on GitHub
Home / Components / action-swap

Action SwapAndroid

Blur/roll/cascade content-swap primitives — ActionSwapButton, ActionSwapText, ActionSwapIcon — plus a multi-state cycler.

$ npx lumioui add action-swap
import { ActionSwapText, ActionSwapIcon, ActionSwapButton, ActionSwap } from "@/components/ui/action-swap/action-swap";
Parts: ActionSwapText · ActionSwapIcon · ActionSwapButton
Props31
ActionSwapText
value string Slot identity — when this changes, the text animates.
children ReactNode
mode? ActionSwapMode Swap choreography. "cascade" needs a string child. Default "roll".
animation? LegacySwapAnimation @deprecated Use `mode`. "fade" maps to "blur".
className? string Applied to the root View AND the swapped text (text classes are inert on the View, layout classes are inert on the Text).
ActionSwapIcon
value string Slot identity — when this changes, the icon animates.
children ReactNode
mode? ActionSwapMode Swap choreography ("cascade" falls back to roll — icons are single elements). Default "roll".
animation? LegacySwapAnimation @deprecated Use `mode`.
className? string
ActionSwapButton
items ActionSwapItem[]
value? string Controlled active item id.
defaultValue? string Initial active item id (uncontrolled). Defaults to the first item.
onValueChange? (value: string, item: ActionSwapItem) => void
variant? ActionSwapButtonVariant
size? ActionSwapButtonSize
mode? ActionSwapMode Swap choreography for icon + label slots. Default "roll".
animation? LegacySwapAnimation @deprecated Use `mode`.
iconOnly? boolean Hide the label — icon slot only. Defaults to size === "icon".
cycle? boolean Advance to the next item on press. Default true.
disabled? boolean
className? string
ActionSwap
states ActionSwapState[] States to cycle through. Must have at least 2.
value? number Controlled active index.
defaultValue? number Initial active index (uncontrolled). Default 0.
onStateChange? (index: number) => void
variant? "pill" | "plain" | "outline" Visual style. Default "pill".
mode? ActionSwapMode Swap choreography for icon + label. Default "roll".
accessibilityLabelPrefix? string Accessible label prefix. Default "Swap to".
disabled? boolean
className? string
Action Swap — Modesmodes.tsx
action-swap/variants/modes.tsx open

Blur/roll/cascade content-swap primitives — ActionSwapButton, ActionSwapText, ActionSwapIcon — plus a multi-state cycler.

Action Swap — Sortsort.tsx
action-swap/variants/sort.tsx open

Blur/roll/cascade content-swap primitives — ActionSwapButton, ActionSwapText, ActionSwapIcon — plus a multi-state cycler.

Action Swap — Stylesstyles.tsx
action-swap/variants/styles.tsx open

Blur/roll/cascade content-swap primitives — ActionSwapButton, ActionSwapText, ActionSwapIcon — plus a multi-state cycler.

Action Swap — Text Swaptext-swap.tsx
action-swap/variants/text-swap.tsx open

Blur/roll/cascade content-swap primitives — ActionSwapButton, ActionSwapText, ActionSwapIcon — plus a multi-state cycler.

Action Swap — View Modesview-modes.tsx
action-swap/variants/view-modes.tsx open

Blur/roll/cascade content-swap primitives — ActionSwapButton, ActionSwapText, ActionSwapIcon — plus a multi-state cycler.