Button
Displays a button or a component that looks like a button.
import { Button } from "@murasakijs/ui";export function ButtonDemo() {return <Button>Button</Button>;}Usage
import { Button } from "@murasakijs/ui";<Button>Button</Button>Variants
Use the variant and size props to change a button's appearance.
import { Button } from "@murasakijs/ui";export function ButtonVariantsDemo() {return ( <div className="flex flex-col gap-6"> <div className="flex flex-wrap items-center gap-3"> <Button variant="default">Default</Button> <Button variant="secondary">Secondary</Button> <Button variant="outline">Outline</Button> <Button variant="ghost">Ghost</Button> <Button variant="destructive">Destructive</Button> <Button variant="link">Link</Button> </div> <div className="flex flex-wrap items-center gap-3"> <Button size="sm">Small</Button> <Button size="default">Default</Button> <Button size="lg">Large</Button> </div> </div>);}API Reference
Props
| Prop | Type | Default |
|---|---|---|
variant | "default" | "secondary" | "outline" | "ghost" | "destructive" | "link" | "default" |
size | "default" | "sm" | "lg" | "icon" | "default" |
asChild | boolean | false |
asChild renders Button as its child element (via Radix Slot) instead of a
<button>, so you can apply button styles to e.g. a Link. All other props
are forwarded to the underlying <button> element.