Browse docsCheckbox

ControlsNew

Glass Checkbox

A glass checkbox whose mark draws itself in and out, with an indeterminate state.

pnpm dlx shadcn@4.14.1 add @glassyui/glass-checkbox

Preview

Demos ready. Update 0.

Installation

First add the exact @glassyui mapping to components.json as shown in Getting Started. Then run the pinned item command:

Install Glass Checkbox

pnpm dlx shadcn@4.14.1 add @glassyui/glass-checkbox
What this installs5 files, 2 packages

Direct registry declarations

These values belong to @glassyui/glass-checkbox itself in registry.json.

Package dependencies

  • @radix-ui/react-checkbox
  • clsx

Registry dependencies

  • @glassyui/glass-provider

File targets

  • components/glassyui/glass-checkbox.tsx

Complete installed closure

This follows every namespaced registry dependency recursively and de-duplicates the packages and target files installed with this item.

Package dependencies

  • @radix-ui/react-checkbox
  • clsx

Installed files

  • components/glassyui/glass-checkbox.tsx
  • components/glassyui/glass-provider.tsx
  • components/glassyui/liquid-filters.tsx
  • components/glassyui/lib/preferences.ts
  • components/glassyui/styles/liquid.css

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

GlassCheckbox

Forward-ref Radix checkbox with an optional label and description.

GlassCheckboxProps

Radix checkbox props plus label, description and size.

label

Text beside the box. Clicking it toggles the box.

description

A muted line under the label, linked with aria-describedby.

size

md (default) or sm.

checked

true, false or "indeterminate". Also defaultChecked and onCheckedChange.

Notes

Motion

The tick is a stroke that draws itself and the fill fades, in both directions, so clearing a box moves as smoothly as ticking it. Reduced motion shows the end state at once.

Accessibility

Space toggles. Without a label, name the box with aria-label. Forced colours use the system highlight.

Accessibility

Keep the Radix-backed semantics intact and preserve visible labels, focus states, and keyboard operation when copying the source.

Performance

Use provider quality preferences for dense app screens. Reserve strong refraction for hero or showcase surfaces.