- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Button
A button or a component that looks like a button.
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button>Button</Button>;
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/button
Usage
import { Button } from "@/components/ui/button";<Button>Button</Button>Link
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.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "brand" | "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | "default" | Controls the button styling |
size | "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "sm" | "xl" | "xs" | "default" | Controls the button size |
shape | "default" | "pill" | "default" | Controls the corner radius. pill renders fully rounded |
render | React.ReactElement | - | Render as a different element (e.g., Link) |
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
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button>Button</Button>;
}
Outline
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button variant="outline">Outline</Button>;
}
Secondary
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button variant="secondary">Secondary</Button>;
}
Destructive
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button variant="destructive">Delete</Button>;
}
Ghost
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button variant="ghost">Ghost</Button>;
}
Link
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button variant="link">Link</Button>;
}
Extra-small Size
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button size="xs">Button</Button>;
}
Small Size
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button size="sm">Button</Button>;
}
Large Size
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button size="lg">Button</Button>;
}
Extra-large Size
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button size="xl">Button</Button>;
}
Disabled
import { Button } from "@/components/ui/button";
export default function Particle() {
return <Button disabled>Button</Button>;
}
Icon
import { PlusIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
export default function Particle() {
return (
<Button aria-label="Add" size="icon">
<PlusIcon aria-hidden="true" />
</Button>
);
}
Icon Small Size
import { PlusIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
export default function Particle() {
return (
<Button aria-label="Add" size="icon-sm">
<PlusIcon aria-hidden="true" />
</Button>
);
}
Icon Large Size
import { PlusIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
export default function Particle() {
return (
<Button aria-label="Add" size="icon-lg">
<PlusIcon aria-hidden="true" />
</Button>
);
}
With Icon
import { DownloadIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
export default function Particle() {
return (
<Button>
<DownloadIcon aria-hidden="true" />
Download
</Button>
);
}
With Link
import Link from "next/link";
import { Button } from "@/components/ui/button";
export default function Particle() {
return (
<Button nativeButton={false} render={<Link href="/" />}>
Link
</Button>
);
}
Loading (Disabled While Pending)
"use client";
import { useState } from "react";
import { Button } from "@/components/ui/button";
export default function Particle() {
const [isLoading, setIsLoading] = useState(false);
const handleClick = () => {
setIsLoading(true);
window.setTimeout(() => {
setIsLoading(false);
}, 1000);
};
return (
<Button disabled={isLoading} onClick={handleClick}>
Submit
</Button>
);
}
Loading (With Spinner)
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
export default function Particle() {
return (
<Button disabled>
<Spinner />
Loading...
</Button>
);
}