Button
Buttons allow users to perform actions and make choices with a single click or tap.
Installation
Add the Button component to your project using the Binhlaig UI CLI.
npx binhlaig-ui@latest add buttonImport
Import the Button component from your UI components directory.
import { Button } from "@/components/ui/button";Usage
Use the default button for primary actions in your application.
Variants
Use different visual styles to represent action priority and meaning.
Sizes
Buttons are available in small, medium and large sizes.
With Icons
Add icons before or after button labels to make actions easier to understand.
Icon Only
Icon-only buttons are useful for compact toolbars and repeated actions.
Loading State
Disable the button and show a spinner while an action is processing.
Full Width
Set the button width to fill its parent container.
Disabled State
Disabled buttons prevent interaction and appear with reduced opacity.
API Reference
Properties available on the Binhlaig UI Button component.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "secondary" | "outline" | "ghost" | "danger" | "primary" | Controls the visual style of the button. |
size | "sm" | "md" | "lg" | "icon" | "md" | Controls the height and padding. |
disabled | boolean | false | Prevents users from interacting with the button. |
className | string | — | Adds custom Tailwind CSS classes. |
children | React.ReactNode | — | Content rendered inside the button. |