Checkbox

Toggle control for boolean input. Install Checkbox from the VLLNT UI registry with the shadcn CLI.

Report a bug

Toggle control for boolean input. Part of the core family in VLLNT UI, it ships as a machine-readable registry entry — copy the source directly into your app with the shadcn CLI and own it, no runtime dependency on a component library.

Preview

Switch between light and dark to inspect the embedded Storybook preview.

Installation

Add Checkbox to your project with the shadcn CLI. The source lands in your codebase, ready to adapt:

pnpm dlx shadcn@latest add https://ui.vllnt.ai/r/checkbox.json

Source

"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 = ({ className, ref: reference, ...props }: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & { ref?: React.Ref<React.ComponentRef<typeof CheckboxPrimitive.Root>>; }) => ( <CheckboxPrimitive.Root className={cn( "peer size-4 shrink-0 rounded border border-input bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary", className, )} ref={reference} {...props} > <CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")} > <Check className="size-4" /> </CheckboxPrimitive.Indicator> </CheckboxPrimitive.Root> ); Checkbox.displayName = CheckboxPrimitive.Root.displayName; export { Checkbox };

Stories

Explore every variant and state in the interactive Storybook:

Preview

Switch between light and dark to inspect the embedded Storybook preview.

Dependencies

  • @vllnt/ui@^0.3.0