Button

Button Variants

Different visual styles for various use cases.

<Button variant="primary">
Click Me
</Button>

Semantic Color Variants

Semantic colors for different actions and states.

<Button variant="info">
Submit
</Button>

Button Sizes

Five sizes from extra small to extra large.

<Button size="md">
Button
</Button>

Buttons with Icons

Add icons on the left or right side of the button text.

<Button
leftIcon={<Search className="w-4 h-4" />}>
Search
</Button>

Loading State

Show loading spinner and disable interaction.

<Button isLoading>
Save Changes
</Button>

Disabled State

Disabled buttons cannot be interacted with.

<Button disabled>
Disabled Button
</Button>

Full Width Button

Use className to make buttons full width.

<Button className="w-full">
Full Width Button
</Button>

Button as Link

Add an href prop to render the button as an anchor tag with full button styling.

<Button href="/contact" variant="primary">
Navigate
</Button>
<Button href="/docs" variant="outline">
Learn More
</Button>

Note: When using href, the button renders as an <a> tag instead of a <button>. All button styles and features (variants, sizes, icons) work the same way.


API Reference

PropTypeDefaultDescription
variant"primary" | "secondary" | "outline" | "ghost" | "info" | "success" | "warning" | "error""primary"Visual style of the button
size"xs" | "sm" | "md" | "lg" | "xl""md"Size of the button (padding and font size)
disabledbooleanfalseDisables the button and prevents interactions
isLoadingbooleanfalseShows loading spinner and disables the button
leftIconReactNodeundefinedIcon or element to display on the left side
rightIconReactNodeundefinedIcon or element to display on the right side
hrefstringundefinedWhen provided, renders button as an anchor tag for navigation
onClick() => voidundefinedClick event handler
classNamestringundefinedAdditional CSS classes to apply
childrenReactNoderequiredButton content (text or elements)

React UI Components

Interactive Showcase