Liquid Glass Checkbox
A Liquid Glass checkbox over Base Checkbox with optical material tinting, indeterminate state, and readable opaque fallbacks.
Liquid Glass Checkbox pairs a 20px concentric-radius control surface with restrained optical refraction and selection tinting, supporting unchecked, checked, and indeterminate (mixed) states with high-contrast opaque fallbacks.
Preview
Section titled “Preview”<div class="flex items-center gap-3">
<wc-liquid-glass-checkbox-root default-checked>
<wc-liquid-glass-checkbox-indicator></wc-liquid-glass-checkbox-indicator>
</wc-liquid-glass-checkbox-root>
<wc-liquid-glass-label-root>
Subscribe to release notes
</wc-liquid-glass-label-root>
</div>Installation
Section titled “Installation”Liquid Glass Checkbox is currently available from workspace source. Import checkboxRoot and checkboxIndicator from @proto.ui/prototypes-liquid-glass or @proto.ui/prototypes-liquid-glass/checkbox.
import { LiquidGlassCheckboxIndicator, LiquidGlassCheckboxRoot, LiquidGlassLabelRoot,} from '@proto.ui/prototypes-liquid-glass';
export function Example() { return ( <div className="flex items-center gap-3"> <LiquidGlassCheckboxRoot defaultChecked> <LiquidGlassCheckboxIndicator /> </LiquidGlassCheckboxRoot> <LiquidGlassLabelRoot>Subscribe to release notes</LiquidGlassLabelRoot> </div> );}Material hierarchy and accessibility
Section titled “Material hierarchy and accessibility”- Optical surface and selection tint:
material="auto"requests backdrop refraction where supported and applies a primary fill tint (tint: 'style-fill') when checked or indeterminate.Indicatorstays passive with no secondary glass layer, avoiding glass-on-glass stacking. - Automatic preference fallbacks: Reduced transparency, increased contrast, forced colors, and disabled states automatically resolve to readable opaque fills, while reduced motion disables press deformation.
- Explicit opaque mode: Set
material="opaque"for dense forms or solid panels where translucent material is unnecessary.
Examples
Section titled “Examples”Description and card row
Section titled “Description and card row”<div class="flex items-center gap-3">
<wc-liquid-glass-checkbox-root default-checked>
<wc-liquid-glass-checkbox-indicator></wc-liquid-glass-checkbox-indicator>
</wc-liquid-glass-checkbox-root>
<wc-liquid-glass-label-root>
Accept terms and conditions
</wc-liquid-glass-label-root>
</div>Disabled and read-only
Section titled “Disabled and read-only”Disabled state uses a distinct muted opaque fill instead of whole-host opacity so boundaries and checkmarks remain legible over colorful backdrops.
<div class="flex items-center gap-3">
<wc-liquid-glass-checkbox-root disabled default-checked>
<wc-liquid-glass-checkbox-indicator></wc-liquid-glass-checkbox-indicator>
</wc-liquid-glass-checkbox-root>
<wc-liquid-glass-label-root>
Audit logging enabled (locked)
</wc-liquid-glass-label-root>
</div>Optical auto vs. opaque
Section titled “Optical auto vs. opaque”Compare material="auto" and material="opaque" side by side over a rich backdrop.
<div class="flex items-center gap-3">
<wc-liquid-glass-checkbox-root material="opaque" default-checked>
<wc-liquid-glass-checkbox-indicator></wc-liquid-glass-checkbox-indicator>
</wc-liquid-glass-checkbox-root>
<wc-liquid-glass-label-root>
Opaque surface (opaque)
</wc-liquid-glass-label-root>
</div>Controlled and indeterminate
Section titled “Controlled and indeterminate”<div class="flex items-center gap-3">
<wc-liquid-glass-checkbox-root indeterminate>
<wc-liquid-glass-checkbox-indicator></wc-liquid-glass-checkbox-indicator>
</wc-liquid-glass-checkbox-root>
<wc-liquid-glass-label-root>
Sync workspace preferences
</wc-liquid-glass-label-root>
</div><div class="flex items-center gap-3">
<wc-liquid-glass-checkbox-root indeterminate>
<wc-liquid-glass-checkbox-indicator></wc-liquid-glass-checkbox-indicator>
</wc-liquid-glass-checkbox-root>
<wc-liquid-glass-label-root>
Select all rows
</wc-liquid-glass-label-root>
</div>| Prop | Type | Default |
|---|---|---|
material | 'auto' 'opaque' | 'auto' |
checked | boolean undefined | uncontrolled |
defaultChecked | boolean | false |
indeterminate | boolean undefined | uncontrolled |
defaultIndeterminate | boolean | false |
disabled | boolean | false |
readOnly | boolean | false |
required | boolean | false |
Root exposes checked, indeterminate, disabled, readOnly, required, hovered, focused, focusVisible, and pressed states, focusSelf(options?) and resetValue() methods, and checkedChange ({ checked, indeterminate }) and indeterminateChange ({ indeterminate }) events.
Indicator
Section titled “Indicator”Indicator declares no props and no optical material of its own. It mirrors the enclosing Root state and exposes checked, indeterminate, isChecked(), and isIndeterminate().