Component

Stateful Button

Button component with built-in state visualizations.

Installation

Usage

Default

Default behavior of the button

1<StatefulButton>Deploy</StatefulButton>

Loading

Progress feedback using loading state.

1<StatefulButton state="loading" loadingText="Processing" />

Success

Success feedback using success state.

1<StatefulButton state="success" successText="Done" />

Error

Error feedback using error state.

1<StatefulButton state="error" errorText="Error" />

Warning

Warning feedback using warning state.

1<StatefulButton state="warning" warningText="Warning" />

Props

PropTypeDefaultDescription
childrenReact.ReactNodeContent rendered in the default state (text, icons, etc.).
classNamestringUtility classes for fine-tuning spacing, color, or layout.
size'default' | 'sm' | 'lg' | 'icon'defaultPreset size variants that adjust height, padding, and gap.
state'default' | 'loading' | 'success' | 'error' | 'disabled' | 'warning'defaultControls gradient theme, motion feedback, and overrides button content.
loadingTextstringLoadingMessage displayed while in the loading state.
successTextstringSuccessMessage displayed while in the success state.
errorTextstringErrorMessage displayed while in the error state.
warningTextstringWarningMessage displayed while in the warning state.
...propsMotionProps & React.ButtonHTMLAttributes<HTMLButtonElement>All extra motion and native button attributes, including disabled.