Controls
Glass Checkbox
A tick box whose mark draws itself in, with a label, description and a mixed state.
Preview
Installation
Install the package once, then import the parts you use into a standalone component.
Install
npm install ngx-vitreo @angular/cdk @floating-ui/domImport
import { GlassCheckbox } from 'ngx-vitreo';
@Component({
imports: [GlassCheckbox],
// ...
})Usage
Usage
<glass-panel class="cpreview-choices" variant="card">
<glass-checkbox
label="All channels"
[checked]="overall()"
(checkedChange)="setAll($event)"
/>
<div class="cpreview-choices-nested">
@for (channel of channels; track channel) {
<glass-checkbox
size="sm"
[label]="channel"
[checked]="selected().includes(channel)"
(checkedChange)="setChannel(channel, $event)"
/>
}
</div>
</glass-panel>API reference
GlassCheckbox
<glass-checkbox>, button[glassCheckbox]
| Input | Type | Default | Description |
|---|---|---|---|
[(checked)] | boolean | 'indeterminate' | false | Checked state; 'indeterminate' shows a dash for a parent of several choices. (checkedChange) emits when the user toggles the box. |
label | string | None | Text beside the box; clicking it toggles the box. Use button[glassCheckbox] with aria-label for a bare box. |
description | string | None | Muted line under the label, linked with aria-describedby. Shown only with a label. |
size | 'sm' | 'md' | 'md' | Box size: 16px or 20px. |
disabled / required | boolean | false | Native form state, mirrored to data-disabled and aria-required. |
name / value | string | — / 'on' | Submits the box with a native form when checked. |
ngModel / formControl | ControlValueAccessor | None | Binds the value to a template-driven or reactive form, including disabled state. |