Docs
GPT Button

GPT Button

Display a GPT style button

Installation

pnpm dlx dopx add gpt-button

Usage

import { GPTButton } from "@/components/ui/gpt-button"
<GPTButton variant="destructive">GPT Button</GPTButton>

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

import { buttonVariants } from "@/components/ui/gpt-button"
<Link className={buttonVariants({ variant: "destructive" })}>Click here</Link>

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

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

Examples

Primary

Destructive

Changelog

2024-10-16 Classes for icons

Added gap-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 to the button to automatically style icon inside the button.

Add the following classes to the cva call in your button.tsx file.

button.tsx
const buttonVariants = cva(
  "inline-flex ... gap-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
)