Button
Accessible action buttons with variants, sizes, icons, loading states and full-width support.
Installation
Initialize Binhlaig UI once, then install Button with Native Beta or Shadcn Stable.
Initialize your project first
Native initialization creates binhlaig.json, lib/utils.ts, the UI directory, required CSS and dependencies.
npx --yes binhlaig-ui@latest initnpx binhlaig-ui@latest add buttonImport
Import Button from your project UI directory.
import { Button } from "@/components/ui/button";Usage
Use the default button for a primary action.
Variants
Choose a visual style that matches action priority and meaning.
Sizes
Use small, medium, large and extra-large button sizes.
Border Radius
Control the corner radius independently from size.
With Icons
Place an icon before or after the label.
Icon Only
Use accessible labels for compact icon-only actions.
Loading State
Disable interaction and show progress while an action runs.
Full Width
Fill the available width of the parent container.
Disabled State
Prevent interaction and communicate unavailable actions.
Update or Overwrite
Replace an existing local Button file with the latest registry version.
Back up custom changes first
The overwrite option replaces your current component source file.
npx binhlaig-ui@latest add button --overwriteAPI Reference
Properties available on the Binhlaig UI Button component.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "secondary" | "outline" | "ghost" | "danger" | "destructive" | "success" | "warning" | "link" | "default" | Controls the visual style. |
size | "sm" | "md" | "default" | "lg" | "xl" | "icon" | "iconSm" | "iconLg" | "md" | Controls dimensions and typography. |
radius | "none" | "sm" | "md" | "lg" | "full" | "lg" | Controls corner radius. |
fullWidth | boolean | false | Fills the parent width. |
loading | boolean | false | Shows progress and disables interaction. |
loadingText | string | — | Label displayed while loading. |
leftIcon | React.ReactNode | — | Icon before the label. |
rightIcon | React.ReactNode | — | Icon after the label. |
disabled | boolean | false | Prevents interaction. |
className | string | — | Adds custom classes. |
children | React.ReactNode | — | Content inside the button. |