The Button component offers four distinct variants to fit different UI needs: primary for main call-to-action buttons, secondary for less visually dominant actions, danger for destructive actions, and naked for minimal buttons without background.
Button with different sizes
Buttons can be sized using the size prop with three options: sm for compact buttons, md for the default medium size, and xl for larger, more prominent buttons.
Loading state of the button
The isLoading prop provides a CSS-only loader state that maintains the button's original dimensions to prevent layout shifts during loading transitions. This ensures a smooth UI experience, especially in forms or button groups where sudden width changes could disrupt the layout.
Disabled state of the buttons
Buttons can be disabled using the standard disabled prop. When disabled, buttons show a reduced opacity and are not interactive, providing clear visual feedback to users.
Icon-only buttons
The icon prop creates a square button with equal padding on all sides, perfect for icon-only buttons. This works with all variants and sizes.