Browse docsCheckbox

ControlsNew

Glass Checkbox

A glass checkbox with an optional label, description and indeterminate state.

Preview

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-checkbox

Adds 5 files to components/glassyui and installs @radix-ui/react-checkbox and clsx.

Usage

Usage

import { GlassCheckbox } from "@/components/glassyui/glass-checkbox";

export function CheckboxDemo() {
  return <GlassCheckbox defaultChecked label="Email me updates" description="One a month, at most." />;
}

Examples

A parent of several choices

<GlassCheckbox
  checked={all ? true : none ? false : "indeterminate"}
  label="All channels"
  onCheckedChange={(checked) => setChannels(checked === true ? CHANNELS : [])}
/>
Without a visible label

<GlassCheckbox aria-label="Select row" size="sm" />

API reference

GlassCheckbox

With a label, className goes to the wrapper; without one, to the box.

PropTypeDefaultDescription
checked / defaultCheckedboolean | 'indeterminate'NoneChecked state; 'indeterminate' shows a dash for a parent of several choices.
onCheckedChange(checked: boolean | 'indeterminate') => voidNoneCalled when the user toggles the box.
labelReactNodeNoneText beside the box; clicking it toggles the box.
descriptionReactNodeNoneMuted line under the label, linked with aria-describedby. Shown only with a label.
size'sm' | 'md''md'Box size: 16px or 20px.

Also accepts Radix Checkbox.Root props, except children.

Types
GlassCheckboxPropsGlassCheckboxSize
Accessibility
Without a label, name the box with aria-label.