Components
Animated Checkbox
A checkbox whose tick draws itself.
<AnimatedCheckbox>
Email me about new components
</AnimatedCheckbox>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/animated-checkbox.jsonimport { AnimatedCheckbox } from "@/components/animated-checkbox"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
A native checkbox drawn as a rounded box whose tick draws itself when checked. The real input stays in the page, so forms, labels and keyboard work as usual.
import { AnimatedCheckbox } from "@/components/animated-checkbox";
export function Terms() {
return <AnimatedCheckbox name="terms" required>I agree to the terms</AnimatedCheckbox>;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | The label. | |
color | string | "#6366f1" | Box colour when checked. |
className | string | Classes for the wrapper. | |
...props | input props | Every native checkbox prop: name, checked, onChange and so on. |
With reduced motion, the tick appears without drawing.