Button

Button component with variants and sizes.

Installation

npx @catalix/cli@latest add button

Usage

page.tsx
import Button from "@/components/core/button"; 

export default function Example() {
  return <Button>Click me</Button>; 
}

Examples

Variants

Sizes

Width

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.

PropTypeDefaultDescription
variant"primary" | "destruct" | "secondary"primaryDefines the visual style of the button
size"sm" | "md" | "lg"mdControls the button size
width"auto" | "full"autoControls the length of the button