examples/button-secondary.tsx
import { Button } from "@/components/wensity/button";export function ButtonSecondary() {return <Button variant="secondary">Save draft</Button>;}
An accessible action primitive with solid, outline, ghost, and destructive variants, plus sizes, icons, and loading state.
Practical examples and common states for the same installable component.
Quiet supporting action that still reads as clickable.
import { Button } from "@/components/wensity/button";export function ButtonSecondary() {return <Button variant="secondary">Save draft</Button>;}
Bright CTA reserved for dark heroes or one-action moments.
Danger action for deletion or irreversible changes.
Optional left and right icon slots without extra wrappers.
Built-in loading state disables the action and keeps width stable.
import { Button } from "@/components/wensity/button";export function ButtonLoading() {return <Button loading>Saving changes</Button>;}
Toolbar and dense UI action with minimal chrome.
import { Button } from "@/components/wensity/button";export function ButtonGhost() {return <Button variant="ghost">Cancel</Button>;}
Disabled buttons keep layout stable while clearly dropping emphasis.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "secondary" | "outline" | "ghost" | "white" | "destructive" | "link" | "default" | Visual weight of the button. white is for dark heroes; link renders as inline text. |
size | "sm" | "md" | "lg" | "icon" | "md" | Control height and padding. icon renders a square button with no gap. |
loading | boolean | false | Swaps the content for a spinner and blocks interaction while an action is in flight. |
disabled | boolean | false | Disables the button and drops it to 45% opacity. |
focusableWhenDisabled | boolean | - | Keeps the button reachable by keyboard while disabled, so screen readers still announce it. |
leftIcon | React.ReactNode | - | Icon rendered before the label. Sized to 16px automatically. |
rightIcon | React.ReactNode | - | Icon rendered after the label. Sized to 16px automatically. |
leftIconMotion | "trash" | "mail" | - | Animates the left icon on hover with a named motion recipe. |
rightIconMotion | "arrow" | "download" | - | Animates the right icon on hover with a named motion recipe. |
asChild | boolean | false | Renders the child element instead of a button, keeping styles. Use for links. |