Componentform0.81 KB gzipZero dependencies
Checkbox Card
Card-style checkbox with title, description and check pop.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add checkbox-cardOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CheckboxCard } from "@/components/ui/checkbox-card"; <CheckboxCard />Source code
checkbox-card.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcheckbox-card.tsx60 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CheckboxCardProps extends React.HTMLAttributes<HTMLLabelElement> { title: string; description?: string; checked?: boolean; defaultChecked?: boolean; onCheckedChange?: (checked: boolean) => void; disabled?: boolean;} /** Card-style checkbox: selectable frame + description + checkmark. */export function CheckboxCard({ title, description, checked, defaultChecked, onCheckedChange, disabled, className, ...props }: CheckboxCardProps) { const [internal, setInternal] = React.useState(defaultChecked ?? false); const isOn = checked ?? internal;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CheckboxCard } from "@/components/ui/checkbox-card"; <CheckboxCard />| Prop | Type | Description |
|---|---|---|
| title | string | Primary heading or title text. |
| description | string | Descriptive helper or subtitle text. |
| checked | boolean | Controlled checked state. |
| defaultChecked | boolean | Initial checked state when uncontrolled. |
| onCheckedChange | (checked: boolean) => void | Callback invoked on checked change. |
| disabled | boolean | Disables interaction and applies disabled styling. |