❤️ Support our project - Your donation helps us continue developing awesome tools!


Docs
Button

Button

Displays a button or a component that looks like a button.

A button

Installation

npx nyxb@latest add button

Usage

import { Button } from "~/components/ui/button"
<Button variant="outline">Button</Button>

You can use the buttonVariants helper to create a link that looks like a button.

import { buttonVariants } from "~/components/ui/button"
<Link className={buttonVariants({ variant: "outline" })}>Click here</Link>

Alternatively, you can set the asChild parameter and nest the link component.

<Button asChild>
  <Link href="/login">Login</Link>
</Button>

Examples

Primary

A primary button

Secondary

A secondary button

Destructive

A destructive button

Outline

A button using the outline variant.

Ghost

A button using the ghost variant

A button using the link variant.

Icon

An icon button

With Icon

A button with an icon

Loading

A button with a loading state.

As Child

A button wrapping a custom Link component

Login