Button
Button component with variants and sizes.
Installation
npx @catalix/cli@latest add buttonUsage
import Button from "@/components/core/button";
export default function Example() {
return <Button>Click me</Button>;
}Examples
Variants
Sizes
Width
Link
You can use the asChild prop to make another component look like a button. Here's an example of a link that looks like a button.
import { Link } from "next/link";
import Button from "@/components/core/button";
export default function Page() {
return (
<Button asChild>
<Link href="/">Login</Link>
</Button>
);
}API Reference
The Button component accepts all standard button props, plus additional custom props.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "primary" | "destruct" | "secondary" | primary | Defines the visual style of the button |
| size | "sm" | "md" | "lg" | md | Controls the button size |
| width | "auto" | "full" | auto | Controls the length of the button |