Button

Versatile button component with multiple styles, sizes, and async support. Perfect for actions, forms, and navigation.

Quick Start

1. Import the component:

import Button, { ButtonStyle } from '@/components/Button';

2. Use in your component:

<Button style={ButtonStyle.primary}>
  Click Me
</Button>

{/* Async button with loading state */}
<Button 
  style={ButtonStyle.primary}
  onClickAsync={async () => {
    await someAsyncOperation();
  }}
>
  Save Changes
</Button>

Button Styles

Various button styles for different contexts and actions

Button States

Disabled and loading states with async operation support

No data

Button Sizes

Multiple size options from x-small to large

or

Buttons with Icons

Combine text and icons for clear action buttons

Icon-Only Buttons

Compact buttons with just icons for toolbar actions

Button Groups

Grouped buttons for segmented controls and related actions

Props Reference

PropTypeDescription
styleButtonStyleButton appearance: primary, secondary, tertiary, danger, success, etc.
classNamestringAdditional CSS classes (btn-xs, btn-sm, btn-lg, etc.)
disabledbooleanDisables the button
onClickAsyncfunctionAsync click handler with automatic loading state
onClickfunctionStandard click handler
roundedbooleanEnable/disable rounded corners (default: true)
childrenReactNodeButton content (text, icons, or mixed)