v0.1 public beta early access on GitHub
Home / Components / stateful-button

Stateful ButtoniOS

Button that morphs label into spinner, check and error shake.

$ npx lumioui add stateful-button
import { StatefulButton } from "@/components/ui/stateful-button/stateful-button";
Props11
children string Label text (idle state).
state? ButtonState Current state — drive it from your async handler, or let the button track it.
onPress? (e: GestureResponderEvent) => void | Promise<unknown> Called on press; return a promise and the button tracks idle → loading → success/error automatically.
loadingLabel? string Label shown while loading. Default: "Loading".
successLabel? string Label shown on success. Default: "Done".
errorLabel? string Label shown on error. Default: original label.
variant? "default" | "destructive" | "outline" | "tinted" Visual style.
size? "sm" | "md" | "lg" Size preset.
resetAfter? number Auto-reset to idle after success. Default 1400ms; 0 keeps success.
className? string Extra classes for the container.
textClassName? string
Stateful Button — Autoauto.tsx
stateful-button/variants/auto.tsx open

Button that morphs label into spinner, check and error shake.

Stateful Button — Controlledcontrolled.tsx
stateful-button/variants/controlled.tsx open

Button that morphs label into spinner, check and error shake.

Stateful Button — Errorerror.tsx
stateful-button/variants/error.tsx open

Button that morphs label into spinner, check and error shake.

Stateful Button — Variantsvariants.tsx
stateful-button/variants/variants.tsx open

Button that morphs label into spinner, check and error shake.