- Accordion
- Agent Thinking
- Alert
- Alert Dialog
- Announcement
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Checkbox
- Checkbox Card
- Code Block
- Collapsible
- Color Picker
- Combobox
- Command
- Composer
- Composer Loader
- Context Menu
- Data Grid
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- File Upload
- Hover Card
- Input
- Input Group
- Input Otp
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Meter
- Native Select
- Navigation Menu
- Number Field
- Pagination
- Period Switcher
- Popover
- Progress
- Questionnaire
- Radio Card
- Radio Group
- Resizable
- Reveal
- Scroll Area
- Search Field
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Social Button
- Sonner
- Spinner
- Status Dot
- Switch
- Switch Card
- Table
- Tabs
- Tag Group
- Textarea
- Theme Toggle
- Time Field
- Toggle
- Toggle Group
- Tooltip
- Trace
- Tree View
- Agent Creator 01
- Agent Limits Card 01
- Agent Progress 01
- AI Chat 01
- AI Image Generation 01
- AI Profile 01
- Alerts Card 01
- Auth Card 01
- Calendar 01
- Composer 01
- Composer Attachments 01
- Composer Panel 01
- Finance Dashboard 01
- Home Dashboard 01
- Marketing Dashboard 01
- Medical Profile 01
- Meeting Scheduler 01
- Multi Agent Chat 01
- Notification Center 01
- Patient Info Card 01
- Project Board 01
- Questionnaire 01
- Settings Modal 01
- Sidebar 01
- Stat Cards 01
- Task List 01
- Web Search 01
- Activity Rings Card 01
- Area Chart Card 01
- Bar List Card 01
- Combo Chart Card 01
- Contributions Card 01
- Earnings Chart Card 01
- Funnel Chart Card 01
- Heatmap Chart Card 01
- Line Chart Card 01
- Most Active Days Card 01
- Orders Chart Card 01
- Radar Chart Card 01
- Radial Chart Card 01
- Revenue Chart Card 01
- Sankey Chart Card 01
- Scatter Chart Card 01
- Sleep Score Card 01
- Stage Bars Card 01
- Steps Card 01
Installation
$ pnpm dlx shadcn@latest add @cobalt/checkbox-card
Source
"use client";
import { cn } from "cn";
import * as React from "react";
import { Checkbox } from "@/components/ui/checkbox";
type CheckboxCardProps = Omit<
React.ComponentProps<typeof Checkbox>,
"children" | "className" | "title"
> & {
title: React.ReactNode;
description?: React.ReactNode;
className?: string;
};
function CheckboxCard({
className,
title,
description,
disabled,
...props
}: CheckboxCardProps) {
return (
<label
data-slot="checkbox-card"
data-disabled={disabled ? "" : undefined}
className={cn(
"group/checkbox-card relative isolate flex w-full before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:ring-inset has-data-checked:before:ring-2 cursor-pointer items-center justify-between gap-3 rounded-[10px] border border-[var(--border-subtle,var(--border))] bg-card py-3 pe-5 ps-4 shadow-[0_1px_1px_0_rgb(0_0_0/0.05)] ring-2 ring-transparent ring-inset transition-[box-shadow] duration-150 ease-[ease] select-none dark:shadow-[0_1px_1px_0_rgb(0_0_0/0.14)] has-data-checked:before:ring-primary has-data-checked:transition-none motion-reduce:transition-none hover:not-data-disabled:not-has-data-checked:ring-[var(--border-hover,var(--border))] data-disabled:cursor-not-allowed data-disabled:opacity-50",
className
)}
>
<span className="flex min-w-0 flex-col gap-0.5">
<span className="truncate text-sm leading-5 font-medium text-foreground">
{title}
</span>
{description != null && (
<span className="truncate text-sm leading-5 font-normal text-muted-foreground">
{description}
</span>
)}
</span>
<span className="flex shrink-0 items-center py-1">
<Checkbox
disabled={disabled}
className="data-disabled:opacity-100 group-hover/checkbox-card:not-data-disabled:border-[var(--checkbox-border-hover,var(--ring))] group-hover/checkbox-card:not-data-disabled:data-checked:before:opacity-100 group-hover/checkbox-card:not-data-disabled:data-indeterminate:before:opacity-100"
{...props}
/>
</span>
</label>
);
}
export { CheckboxCard };
export type { CheckboxCardProps }; On this page