Skip to content

Button

A button or a component that looks like a button.

Installation

pnpm dlx shadcn@latest add @frontal-labs/button

Usage

import { Button } from "@/components/ui/button";
<Button>Button</Button>

You can use the render 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/ui/button";
 
export function LinkAsButton() {
  return <Button render={<Link href="/login" />}>Login</Button>;
}

API Reference

This is a custom component using Base UI's useRender hook, not a direct Base UI wrapper.

Button

A button component with variant, size, and shape options.

The destructive variant is a solid fill (bg-destructive with text-destructive-foreground), not a tint. The earlier tinted treatment — destructive-coloured text on a 10% destructive wash — measured 4.09:1 in light mode and fell to 3.39:1 on hover, both below WCAG AA. The solid pairing clears AA in both themes and gives a delete action the visual weight it should carry.

There is no loading prop. Compose a disabled button with a Spinner, or drive disabled from your own state.

Examples

Default

Outline

Secondary

Destructive

Ghost

Extra-small Size

Small Size

Large Size

Extra-large Size

Disabled

Icon

Icon Small Size

Icon Large Size

With Icon

Loading (Disabled While Pending)

Loading (With Spinner)