import * as React from "react"; import * as RadixCheckbox from "@radix-ui/react-checkbox"; import { cn } from "../../utils/cn"; import { useUiId } from "../../hooks"; export interface CheckboxProps extends Omit, "asChild"> { label?: React.ReactNode; description?: string; } /** Checkbox built on Radix's primitive for correct tri-state (checked/unchecked/indeterminate) semantics. */ export const Checkbox = React.forwardRef, CheckboxProps>( ({ className, label, description, id, ...props }, ref) => { const autoId = useUiId("checkbox"); const checkboxId = id ?? autoId; return (
{(label || description) && (
{label && } {description &&

{description}

}
)}
); } ); Checkbox.displayName = "Checkbox";