Button

stable

Interactive button with 6 visual variants and multiple sizes. Supports rendering as child elements via asChild.

Source: packages/ui/src/components/Button.tsx

Accessibility

No accessibility audit yet. Run the a11y pipeline to generate results.

Playground

disabled
false
import { Button } from "@itu/ui"

<Button>Click me</Button>

Props

PropTypeDefaultRequiredDescription
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""default"OptionalThe visual style variant of the button
size"default" | "sm" | "lg" | "icon""default"OptionalThe size of the button
asChildbooleanfalseOptionalRender as child element instead of button
disabledbooleanfalseOptionalWhether the button is disabled

Variants

variant

default: default
default
destructive
outline
secondary
ghost
link

size

default: default
default
sm
lg
icon

Usage

The Button component is the primary interactive element across the ITU platform. It wraps an HTML <button> (or any element via asChild) and applies consistent sizing, color, and focus styles from the design token system.

Buttons are exported from @itu/ui and are built on Radix UI Slot so they can render as links or other elements without losing their visual treatment.

tsx
import { Button } from "@itu/ui";
 
export function Example() {
return (
<div className="flex gap-3">
<Button>Save changes</Button>
<Button variant="outline">Cancel</Button>
<Button variant="destructive">Delete</Button>
</div>
);
}
11 lines of tsx code

Use asChild to render the button styles on an <a> tag or a Next.js <Link>:

tsx
import Link from "next/link";
import { Button } from "@itu/ui";
 
<Button asChild>
<Link href="/dashboard">Go to dashboard</Link>
</Button>
6 lines of tsx code

Variant guide

VariantWhen to use
defaultPrimary actions — the most prominent call to action on a surface
destructiveIrreversible actions such as deleting a record
outlineSecondary actions alongside a primary button
secondaryLower-emphasis actions in toolbars or filter panels
ghostTertiary actions where a full button frame would be too heavy
linkInline navigation that should read as a text link

Button also accepts all standard HTML <button> attributes (onClick, type, aria-*, etc.) via prop spreading.