Components/Button
Binhlaig UI Component

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.

Terminal
npx binhlaig-ui@latest add button

Import

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.

PropTypeDefaultDescription
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.
disabledbooleanfalsePrevents users from interacting with the button.
classNamestringAdds custom Tailwind CSS classes.
childrenReact.ReactNodeContent rendered inside the button.