Command Palette

Search for a command to run...

Button

Enhanced button with loading states, animated icon transitions, and smooth animations powered by Framer Motion.

Variants

Sizes

With Icons

Loading States(click to try)

Custom Loader Icons

Disabled

Documentation

Installation

This component extends the shadcn/ui Button. First, install the base component:

Terminal
Loading...

Then install the required dependencies for animations:

Terminal
Loading...

Basic Usage

example.tsx
Loading...

Variants

Use the variant prop to change the button style.

variants.tsx
Loading...

Sizes

Use the size prop to change the button size. Available sizes: sm, default, lg, icon, icon-sm, icon-lg.

sizes.tsx
Loading...

With Icons

Add icons from lucide-react before or after the button text. Icons animate smoothly with the button state.

icons.tsx
Loading...

Loading State

The loading prop displays an animated spinner and automatically disables the button. When loading, any icons animate out smoothly.

loading.tsx
Loading...

Custom Loader Icon

Use the loaderIcon prop to customize the loading spinner. Pass any Lucide icon component.

custom-loader.tsx
Loading...

API Reference

PropTypeDefaultDescription
loadingbooleanfalseShows loading spinner and disables button
loaderIconLucideIconLoader2Custom loading spinner icon
variant"default" | "secondary" | "destructive" | "outline" | "ghost" | "link""default"Visual style variant
size"sm" | "default" | "lg" | "icon" | "icon-sm" | "icon-lg""default"Button size
asChildbooleanfalseMerge props onto child element (Radix Slot)
disabledbooleanfalseDisables button interaction
DuskUI - Animated React Component Library