Accessible, theme-aware button component with variants and sizes for React apps.
// Source: https://github.com/mohammed-bahumaish/prisma-editor | License: MIT | Copyright 2025 Mohammed Bahumaish
// Provided via justclaw.it.com; keep this notice with the code.
import * as React from "react";
import { type VariantProps, cva } from "class-variance-authority";
import { cn } from "~/components/ui/lib/cn";
const buttonVariants = cva(
"inline-flex items-center justify-center rounded-md text-sm font-medium focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 dark:hover:bg-slate-800 dark:hover:text-slate-100 disabled:opacity-50 dark:focus:ring-slate-400 disabled:pointer-events-none dark:focus:ring-offset-slate-900 data-[state=open]:bg-slate-100 dark:data-[state=open]:bg-slate-800",
{
variants: {
variant: {
default:
"bg-slat
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key