Button
Clickable button with variants
UI PrimitiveForm Inputs
Overview
Button is the foundational interactive element. It supports six visual variants and eight size options, is fully accessible via keyboard, and accepts an asChild prop for rendering as any element (e.g., a link) while keeping button styling.
Usage
import { Button } from "@leanicon/web-builder-library";
<Button>Get started</Button>;Variants
Visual variants
Sizes
With icon
As link (asChild)
Use asChild to delegate rendering to a child element while keeping all button styles applied.
Disabled
Notes
- Icon-only buttons must include an
aria-labelfor screen reader accessibility. asChilduses Radix UISlotunder the hood — the child must accept and forwardrefand event props.- Dark mode is handled automatically via semantic design tokens (
bg-primary,text-primary-foreground, etc.).
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
size | "default" | "sm" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | default | No | |
variant | "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | "primary" | null | default | No | |
asChild | boolean | false | No |