ControlsNew
Glass Checkbox
A glass checkbox with an optional label, description and indeterminate state.
Preview
Demos ready. Update 0.
The preview runs the React version. On iOS 26 and later, the React Native version uses the system’s own glass. See it on a phone.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-checkboxAdds 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." />;
}React Native usage
import { useState } from 'react';
import { GlassCheckbox } from '@/components/glassyui/glass-checkbox';
export default function CheckboxExample() {
const [weekly, setWeekly] = useState(true);
return (
<GlassCheckbox
checked={weekly}
description="One email every Monday."
label="Weekly summary"
onCheckedChange={setWeekly}
/>
);
}
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.
| Prop | Type | Default | Description |
|---|---|---|---|
checked / defaultChecked | boolean | 'indeterminate' | None | Checked state; 'indeterminate' shows a dash for a parent of several choices. |
onCheckedChange | (checked: boolean | 'indeterminate') => void | None | Called when the user toggles the box. |
label | ReactNode | None | Text beside the box; clicking it toggles the box. |
description | ReactNode | None | Muted 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.
The React Native props and exports are in the component’s source.