Flow Kit LogoFlow Kit

Loader Button

A button that transitions through loading, success, and error states with smooth animations. Ideal for form submissions, async actions, and any interaction that needs visual feedback.

Preview

Installation

npm install motion lucide-react

API Reference

LoaderButton

PropTypeDefaultDescription
state"idle" | "loading" | "success" | "error"RequiredControls the current button state
childrenReact.ReactNode"Submit"Content shown in the idle state
successLabelReact.ReactNode✓ SuccessContent shown in the success state
errorLabelReact.ReactNode✗ ErrorContent shown in the error state
loaderReact.ReactNode<LoadingSpinner />Content shown in the loading state
classNamestringundefinedAdditional CSS classes
disabledbooleanstate !== "idle"Override disabled behavior

Also accepts all standard button HTML attributes via ...props.

LoadingSpinner

A standalone animated spinner with four pulsing bars. Can be used independently or as the default loader inside LoaderButton.