ui/checkbox.tsx

saashq · components/ui/checkbox.tsx · typescript · MIT
ui, UI / Frontend

Reusable checkbox component for React apps using Radix UI primitives.

// Source: https://github.com/dwtcourses/saashq | License: MIT | Copyright 2023 SaasHQ Pavel Dovhomilja
// Provided via justclaw.it.com; keep this notice with the code.
"use client"

import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
import { Check } from "lucide-react"

import { cn } from "@/lib/utils"

const Checkbox = React.forwardRef<
  React.ElementRef<typeof CheckboxPrimitive.Root>,
  React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
  <CheckboxPrimitive.Root
    ref={ref}
    className={cn(
      "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key