BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Animate UI/components-base-checkbox

Checkbox

animate-ui/components-base-checkbox
FreeComponent

An easily stylable checkbox component.

Install it

npx shadcn@latest add https://animate-ui.com/r/components-base-checkbox.json

Source

registry/components/base/checkbox/index.tsxanimate-ui.com/r/components-base-checkbox.json
1import * as React from 'react';
2
3import {
4 Checkbox as CheckboxPrimitive,
5 CheckboxIndicator as CheckboxIndicatorPrimitive,
6 type CheckboxProps as CheckboxPrimitiveProps,
7} from '@/components/animate-ui/primitives/base/checkbox';
8import { cn } from '@/lib/utils';
9import { cva, type VariantProps } from 'class-variance-authority';
10
11const checkboxVariants = cva(
12 'peer shrink-0 flex items-center justify-center outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:opacity-50 transition-colors duration-500 focus-visible:ring-offset-2 [&[data-checked],&[data-indeterminate]]:bg-primary [&[data-checked],&[data-indeterminate]]:text-primary-foreground',
13 {
14 variants: {
15 variant: {
16 default: 'bg-background border',
17 accent: 'bg-input',
18 },
19 size: {
20 default: 'size-5 rounded-sm',
21 sm: 'size-4.5 rounded-[5px]',
22 lg: 'size-6 rounded-[7px]',
23 },
24 },
25 defaultVariants: {
26 variant: 'default',
27 size: 'default',
28 },
29 },
30);
31
32const checkboxIndicatorVariants = cva('', {
33 variants: {
34 size: {
35 default: 'size-3.5',
36 sm: 'size-3',
37 lg: 'size-4',
38 },
39 },
40 defaultVariants: {
41 size: 'default',
42 },
43});
44
45type CheckboxProps = CheckboxPrimitiveProps &
46 VariantProps<typeof checkboxVariants> & {
47 children?: React.ReactNode;
48 };
49
50function Checkbox({
51 className,
52 children,
53 variant,
54 size,
55 ...props
56}: CheckboxProps) {
57 return (
58 <CheckboxPrimitive
59 className={cn(checkboxVariants({ variant, size, className }))}
60 {...props}
61 >
62 {children}
63 <CheckboxIndicatorPrimitive
64 className={cn(checkboxIndicatorVariants({ size }))}
65 />
66 </CheckboxPrimitive>
67 );
68}
69
70export { Checkbox, type CheckboxProps };

What it pulls in

npm packages

  • class-variance-authority

Other registry items

  • @animate-ui/primitives-base-checkbox

Files it writes

  • registry/components/base/checkbox/index.tsx

Facts

Registry
Animate UI
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

animate-ui.com imskyleen/animate-ui on GitHub Raw registry item This item as JSON

More from Animate UI

All 580 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Avatar Groupcomponents-animate-avatar-groupAnimate UIComponentsFree1 dep
Codecomponents-animate-codeAnimate UIComponentsFree1 dep
Code Tabscomponents-animate-code-tabsAnimate UIComponentsFree1 dep
Cursorcomponents-animate-cursorAnimate UIComponentsFreeno deps
GitHub Stars Wheelcomponents-animate-github-stars-wheelAnimate UIComponentsFree1 dep
Tabscomponents-animate-tabsAnimate UIComponentsFreeno deps
Tooltipcomponents-animate-tooltipAnimate UIComponentsFree1 dep
Bubble Backgroundcomponents-backgrounds-bubbleAnimate UIComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex