md-checkbox spec card
Identity · when to use / when NOT · decision cues · behavioural contract · do/don't · anti-patterns · full API. Paste into your agent when you're implementing with this component.
Select none, one, or many from a related set. Tri-state (checked /
unchecked / indeterminate), form-associated via ElementInternals with the
full constraint-validation API, and its own supporting/error line under the
box.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px', cursor: 'pointer' }}>
<MdCheckbox></MdCheckbox> Unchecked
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px', cursor: 'pointer' }}>
<MdCheckbox checked></MdCheckbox> Checked
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px', cursor: 'pointer' }}>
<MdCheckbox indeterminate></MdCheckbox> Indeterminate
</label>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label><script setup>
import '@awc-ui/core/define';
</script>
<template>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>
</template><script>
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>
Already installed? See the
Installation guide for one-time package setup
(core + tokens, fonts). Each tab below shows two patterns for using
md-checkbox in your project: Option A registers every AWC UI
component at once (simplest), Option B imports only this component for
tree-shake-friendly bundles.
<!-- ─── Option A: global registration (all components) ─── -->
<script type="module">
import '@awc-ui/core/define';
</script>
<!-- ─── Option B: single import (tree-shake only md-checkbox) ─── -->
<script type="module">
import '@awc-ui/core/components/md-checkbox';
</script>
<md-checkbox></md-checkbox>// ─── Option A: typed React wrapper (registers all components) ───
// Importing from '@awc-ui/react' calls defineCustomElements() as a
// side effect, so every md-* element becomes available in the browser.
import { MdCheckbox } from '@awc-ui/react';
export function Example() {
return <MdCheckbox></MdCheckbox>;
}
// ─── Option B: single import (tree-shake to only md-checkbox) ───
// Skip the wrapper and use the raw custom element. Smallest bundle,
// but you lose typed props/events on JSX.
import '@awc-ui/core/components/md-checkbox';
export function ExampleTreeShaken() {
return <md-checkbox></md-checkbox>;
}// ─── Option A: schema module (any md-* element accepted) ───
// Pair with `defineCustomElements(window)` in main.ts.
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `<md-checkbox></md-checkbox>`,
})
export class ExampleComponent {}
// ─── Option B: typed directive (tree-shake friendly) ───
// Pair with `import '@awc-ui/core/components/md-checkbox'` in main.ts.
import { Component } from '@angular/core';
import { MdCheckbox } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [MdCheckbox],
template: `<md-checkbox></md-checkbox>`,
})
export class ExampleTreeShakenComponent {}<!-- ─── Option A: typed Vue wrapper (registers all components) ─── -->
<script setup lang="ts">
import { MdCheckbox } from '@awc-ui/vue';
</script>
<template>
<MdCheckbox></MdCheckbox>
</template>
<!-- ─── Option B: single import (tree-shake to only md-checkbox) ─── -->
<script setup lang="ts">
import '@awc-ui/core/components/md-checkbox';
</script>
<template>
<md-checkbox></md-checkbox>
</template><!-- ─── Option A: global registration (done once in main entry) ─── -->
<!-- main.ts: -->
<!-- import { defineCustomElements } from '@awc-ui/svelte'; -->
<!-- defineCustomElements(window); -->
<md-checkbox></md-checkbox>
<!-- ─── Option B: single import (tree-shake to only md-checkbox) ─── -->
<script lang="ts">
import '@awc-ui/core/components/md-checkbox';
</script>
<md-checkbox></md-checkbox>indeterminate for the partial
state.| Situation | Use instead |
|---|---|
| Exactly one option from a list | md-radio |
| A setting that takes effect immediately | md-switch |
| More than ~7 options, or space is tight | md-multi-select |
| Assigning a subset from a large pool | md-transfer-list |
| Filtering by removable criteria | md-chip |
| Two opposing choices (on/off framing) | md-switch, or md-button-group |
| Running an action | md-button |
| Need | Setting |
|---|---|
| Independent on/off choices | This component |
| A mixed “some children checked” state | indeterminate |
| A hint under the control | supporting-text |
| A validation message | error-text |
| Blocks form submission when unchecked | required |
| Unavailable but still discoverable | soft-disabled |
| Smaller box | density="-1…-4" |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox name="news" value="yes"></md-checkbox> Email me updates
</label>
<md-checkbox aria-label="Standalone checkbox with an aria-label"></md-checkbox>
<span id="cb-external-label">Labelled by another element</span>
<md-checkbox aria-labelledby="cb-external-label"></md-checkbox>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px', cursor: 'pointer' }}>
<MdCheckbox name="news" value="yes"></MdCheckbox> Email me updates
</label>
<MdCheckbox aria-label="Standalone checkbox with an aria-label"></MdCheckbox>
<span id="cb-external-label">Labelled by another element</span>
<MdCheckbox aria-labelledby="cb-external-label"></MdCheckbox>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox name="news" value="yes"></md-checkbox> Email me updates
</label>
<md-checkbox aria-label="Standalone checkbox with an aria-label"></md-checkbox>
<span id="cb-external-label">Labelled by another element</span>
<md-checkbox aria-labelledby="cb-external-label"></md-checkbox><script setup>
import '@awc-ui/core/define';
</script>
<template>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox name="news" value="yes"></md-checkbox> Email me updates
</label>
<md-checkbox aria-label="Standalone checkbox with an aria-label"></md-checkbox>
<span id="cb-external-label">Labelled by another element</span>
<md-checkbox aria-labelledby="cb-external-label"></md-checkbox>
</template><script>
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;">
<md-checkbox name="news" value="yes"></md-checkbox> Email me updates
</label>
<md-checkbox aria-label="Standalone checkbox with an aria-label"></md-checkbox>
<span id="cb-external-label">Labelled by another element</span>
<md-checkbox aria-labelledby="cb-external-label"></md-checkbox>Five states, three of them value-carrying and two of them availability modifiers:
| State | Set with | Notes |
|---|---|---|
| Unchecked | (default) | checked absent |
| Checked | checked | Submits value under name |
| Indeterminate | indeterminate | aria-checked="mixed" — presentation only |
| Disabled | disabled | Skipped by Tab |
| Soft-disabled | soft-disabled | Same visuals, still focusable |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox disabled checked></md-checkbox> Disabled
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox soft-disabled></md-checkbox> Soft-disabled
</label>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox></MdCheckbox> Unchecked
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox checked></MdCheckbox> Checked
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox indeterminate></MdCheckbox> Indeterminate
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox disabled checked></MdCheckbox> Disabled
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox soft-disabled></MdCheckbox> Soft-disabled
</label>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox disabled checked></md-checkbox> Disabled
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox soft-disabled></md-checkbox> Soft-disabled
</label><script setup>
import '@awc-ui/core/define';
</script>
<template>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox disabled checked></md-checkbox> Disabled
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox soft-disabled></md-checkbox> Soft-disabled
</label>
</template><script>
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox></md-checkbox> Unchecked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked></md-checkbox> Checked
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox indeterminate></md-checkbox> Indeterminate
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox disabled checked></md-checkbox> Disabled
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox soft-disabled></md-checkbox> Soft-disabled
</label>disabled leaves the tab order entirely. soft-disabled keeps the same
visuals but stays focusable, so a contextually-unavailable option is still
discoverable by keyboard — M3’s preference.
indeterminate renders the dash and exposes aria-checked="mixed". It is
not a third user-selectable value: a click resolves the checkbox to
checked or unchecked and clears the flag. A parent checkbox therefore has to
recompute it every time a child changes.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<label><md-checkbox id="all"></md-checkbox> Select all</label>
<label><md-checkbox class="child" value="a"></md-checkbox> Analytics</label>
<label><md-checkbox class="child" value="b"></md-checkbox> Billing</label>
<script type="module">
const all = document.getElementById('all');
const kids = [...document.querySelectorAll('.child')];
const sync = () => {
const n = kids.filter((k) => k.checked).length;
all.checked = n === kids.length;
all.indeterminate = n > 0 && n < kids.length; // recompute — a click clears it
};
kids.forEach((k) => k.addEventListener('mdChange', sync));
all.addEventListener('mdChange', () => {
kids.forEach((k) => (k.checked = all.checked));
all.indeterminate = false;
});
sync();
</script>import { MdCheckbox } from '@awc-ui/react';
import { useMemo, useState } from 'react';
export function PermissionTree() {
const [kids, setKids] = useState({ a: false, b: false });
const values = Object.values(kids);
const allChecked = values.every(Boolean);
const indeterminate = useMemo(
() => values.some(Boolean) && !allChecked,
[values, allChecked],
);
return (
<>
<label>
<MdCheckbox
checked={allChecked}
indeterminate={indeterminate}
onMdChange={(e) => setKids({ a: e.detail.checked, b: e.detail.checked })}
/>
Select all
</label>
<label>
<MdCheckbox
checked={kids.a}
onMdChange={(e) => setKids((k) => ({ ...k, a: e.detail.checked }))}
/>
Analytics
</label>
<label>
<MdCheckbox
checked={kids.b}
onMdChange={(e) => setKids((k) => ({ ...k, b: e.detail.checked }))}
/>
Billing
</label>
</>
);
}import { Component } from '@angular/core';
@Component({
selector: 'app-permission-tree',
template: `
<label>
<md-checkbox
[checked]="allChecked"
[indeterminate]="indeterminate"
(mdChange)="setAll($event)"
></md-checkbox>
Select all
</label>
<label>
<md-checkbox [checked]="kids.a" (mdChange)="set('a', $event)"></md-checkbox>
Analytics
</label>
<label>
<md-checkbox [checked]="kids.b" (mdChange)="set('b', $event)"></md-checkbox>
Billing
</label>
`,
})
export class PermissionTreeComponent {
kids = { a: false, b: false };
get allChecked() { return this.kids.a && this.kids.b; }
get indeterminate() { return (this.kids.a || this.kids.b) && !this.allChecked; }
set(key: 'a' | 'b', e: CustomEvent) { this.kids[key] = e.detail.checked; }
setAll(e: CustomEvent) { this.kids = { a: e.detail.checked, b: e.detail.checked }; }
}<script setup lang="ts">
import { computed, reactive } from 'vue';
const kids = reactive({ a: false, b: false });
const allChecked = computed(() => kids.a && kids.b);
const indeterminate = computed(() => (kids.a || kids.b) && !allChecked.value);
function setAll(e: CustomEvent) {
kids.a = e.detail.checked;
kids.b = e.detail.checked;
}
</script>
<template>
<label>
<md-checkbox
:checked="allChecked"
:indeterminate="indeterminate"
@mdChange="setAll"
/>
Select all
</label>
<label>
<md-checkbox :checked="kids.a" @mdChange="(e) => (kids.a = e.detail.checked)" />
Analytics
</label>
<label>
<md-checkbox :checked="kids.b" @mdChange="(e) => (kids.b = e.detail.checked)" />
Billing
</label>
</template><script lang="ts">
let kids = { a: false, b: false };
$: allChecked = kids.a && kids.b;
$: indeterminate = (kids.a || kids.b) && !allChecked;
function setAll(e: CustomEvent) {
kids = { a: e.detail.checked, b: e.detail.checked };
}
</script>
<label>
<md-checkbox
checked={allChecked}
{indeterminate}
on:mdChange={setAll}
/>
Select all
</label>
<label>
<md-checkbox checked={kids.a} on:mdChange={(e) => (kids.a = e.detail.checked)} />
Analytics
</label>
<label>
<md-checkbox checked={kids.b} on:mdChange={(e) => (kids.b = e.detail.checked)} />
Billing
</label>A checkbox has nowhere else to show a failed required except the browser’s
transient validation balloon, so it carries its own message line. One line is
rendered, and error-text wins it whenever it is set — the component renders
errorText || supportingText. error does not choose between them: it
recolours that line to the error role and gives it role="alert".
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox supporting-text="You can change this later"></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">Email me updates</span>
</label>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox error error-text="You must accept to continue" required></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<label style={{ display: 'inline-flex', alignItems: 'flex-start', gap: '8px' }}>
<MdCheckbox supportingText="You can change this later"></MdCheckbox>
<span style={{ display: 'flex', alignItems: 'center', minBlockSize: '48px' }}>Email me updates</span>
</label>
<label style={{ display: 'inline-flex', alignItems: 'flex-start', gap: '8px' }}>
<MdCheckbox error errorText="You must accept to continue" required></MdCheckbox>
<span style={{ display: 'flex', alignItems: 'center', minBlockSize: '48px' }}>I accept the terms</span>
</label>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox supporting-text="You can change this later"></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">Email me updates</span>
</label>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox error error-text="You must accept to continue" required></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label><script setup>
import '@awc-ui/core/define';
</script>
<template>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox supporting-text="You can change this later"></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">Email me updates</span>
</label>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox error error-text="You must accept to continue" required></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>
</template><script>
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox supporting-text="You can change this later"></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">Email me updates</span>
</label>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox error error-text="You must accept to continue" required></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>md-checkbox is form-associated through ElementInternals. When checked it
submits value (default "on") under name, and it restores its authored
state on form reset. Don’t add a hidden <input> — the mirror
double-submits.
required genuinely blocks submission. value-missing-label is a prop rather
than a hardcoded string precisely so you can localize the “please check this
box” message.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<form>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox
name="terms"
value="accepted"
required
value-missing-label="Please accept the terms."
error-text="You must accept to continue"
></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>import { MdButton, MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<form>
<label style={{ display: 'inline-flex', alignItems: 'flex-start', gap: '8px' }}>
<MdCheckbox
name="terms"
value="accepted"
required
valueMissingLabel="Please accept the terms."
errorText="You must accept to continue"
></MdCheckbox>
<span style={{ display: 'flex', alignItems: 'center', minBlockSize: '48px' }}>I accept the terms</span>
</label>
<MdButton variant="filled" type="submit">Continue</MdButton>
<MdButton variant="text" type="reset">Reset</MdButton>
</form>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<form>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox
name="terms"
value="accepted"
required
value-missing-label="Please accept the terms."
error-text="You must accept to continue"
></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form><script setup>
import '@awc-ui/core/define';
</script>
<template>
<form>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox
name="terms"
value="accepted"
required
value-missing-label="Please accept the terms."
error-text="You must accept to continue"
></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>
</template><script>
import '@awc-ui/core/define';
</script>
<form>
<label style="display: inline-flex; align-items: flex-start; gap: 8px;">
<md-checkbox
name="terms"
value="accepted"
required
value-missing-label="Please accept the terms."
error-text="You must accept to continue"
></md-checkbox>
<span style="display: flex; align-items: center; min-block-size: 48px;">I accept the terms</span>
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>Reading the submitted value back out — the checkbox appears in FormData under
name only when it is checked, so get('terms') is null for an unchecked box:
<form id="signup">
<label>
<md-checkbox name="terms" value="accepted" required></md-checkbox>
I accept the terms
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>
<script type="module">
document.getElementById('signup').addEventListener('submit', (e) => {
e.preventDefault();
const data = new FormData(e.target);
console.log(data.get('terms')); // 'accepted', or null when unchecked
});
</script>import { MdButton, MdCheckbox } from '@awc-ui/react';
export function SignupForm() {
function onSubmit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault();
const data = new FormData(e.currentTarget);
console.log(data.get('terms')); // 'accepted', or null when unchecked
}
return (
<form onSubmit={onSubmit}>
<label>
<MdCheckbox name="terms" value="accepted" required />
I accept the terms
</label>
<MdButton variant="filled" type="submit">Continue</MdButton>
<MdButton variant="text" type="reset">Reset</MdButton>
</form>
);
}import { Component } from '@angular/core';
@Component({
selector: 'app-signup-form',
template: `
<form (submit)="onSubmit($event)">
<label>
<md-checkbox name="terms" value="accepted" required></md-checkbox>
I accept the terms
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>
`,
})
export class SignupFormComponent {
onSubmit(e: Event) {
e.preventDefault();
const data = new FormData(e.target as HTMLFormElement);
console.log(data.get('terms')); // 'accepted', or null when unchecked
}
}<script setup lang="ts">
function onSubmit(e: Event) {
e.preventDefault();
const data = new FormData(e.target as HTMLFormElement);
console.log(data.get('terms')); // 'accepted', or null when unchecked
}
</script>
<template>
<form @submit="onSubmit">
<label>
<md-checkbox name="terms" value="accepted" required />
I accept the terms
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>
</template><script lang="ts">
function onSubmit(e: Event) {
e.preventDefault();
const data = new FormData(e.target as HTMLFormElement);
console.log(data.get('terms')); // 'accepted', or null when unchecked
}
</script>
<form on:submit={onSubmit}>
<label>
<md-checkbox name="terms" value="accepted" required />
I accept the terms
</label>
<md-button variant="filled" type="submit">Continue</md-button>
<md-button variant="text" type="reset">Reset</md-button>
</form>Methods — getValidity(), checkValidity(), reportValidity() and
setCustomValidity(message) mirror the native constraint-validation API. Use
setCustomValidity('') to clear a server-side message.
| Event | Cancelable | Detail | Fires |
|---|---|---|---|
mdChange | no | { checked, indeterminate } | Whenever the state changes |
mdValidityChange | no | { valid, validationMessage, flags } | Only when validity changes |
Both details are inline shapes — there is no exported …Detail type for either.
The typed handle the library does export is MdCheckboxCustomEvent<T>:
import type { MdCheckboxCustomEvent } from '@awc-ui/core';
type ChangeEvent = MdCheckboxCustomEvent<{ checked: boolean; indeterminate: boolean; // always false after a user click}>;
type ValidityEvent = MdCheckboxCustomEvent<{ valid: boolean; validationMessage: string; flags: Record<string, boolean>; // e.g. { valueMissing: true }}>;<md-checkbox id="terms" name="terms" required></md-checkbox>
<script type="module">
const cb = document.getElementById('terms');
cb.addEventListener('mdChange', (e) => {
console.log(e.detail.checked, e.detail.indeterminate);
});
// Bind on the element itself — this event is composed: false.
cb.addEventListener('mdValidityChange', (e) => {
console.log(e.detail.valid, e.detail.validationMessage);
});
</script>import { MdCheckbox } from '@awc-ui/react';
export function TermsCheckbox() {
return (
<MdCheckbox
name="terms"
required
onMdChange={(e) => console.log(e.detail.checked, e.detail.indeterminate)}
onMdValidityChange={(e) => console.log(e.detail.valid, e.detail.validationMessage)}
/>
);
}import { Component } from '@angular/core';
@Component({
selector: 'app-terms-checkbox',
template: `
<md-checkbox
name="terms"
required
(mdChange)="onChange($event)"
(mdValidityChange)="onValidity($event)"
></md-checkbox>
`,
})
export class TermsCheckboxComponent {
onChange(e: CustomEvent) {
console.log(e.detail.checked, e.detail.indeterminate);
}
onValidity(e: CustomEvent) {
console.log(e.detail.valid, e.detail.validationMessage);
}
}<script setup lang="ts">
function onChange(e: CustomEvent) {
console.log(e.detail.checked, e.detail.indeterminate);
}
function onValidity(e: CustomEvent) {
console.log(e.detail.valid, e.detail.validationMessage);
}
</script>
<template>
<md-checkbox
name="terms"
required
@mdChange="onChange"
@mdValidityChange="onValidity"
/>
</template><script lang="ts">
function onChange(e: CustomEvent) {
console.log(e.detail.checked, e.detail.indeterminate);
}
function onValidity(e: CustomEvent) {
console.log(e.detail.valid, e.detail.validationMessage);
}
</script>
<md-checkbox
name="terms"
required
on:mdChange={onChange}
on:mdValidityChange={onValidity}
/>| Property | Attribute | Type | Default | Reflects |
|---|---|---|---|---|
valueMissingLabel | value-missing-label | string | 'Please check this box if you want to proceed.' | — |
error | error | boolean | false | Yes |
errorText | error-text | string | '' | — |
supportingText | supporting-text | string | '' | — |
checked | checked | boolean | false | Yes |
indeterminate | indeterminate | boolean | false | Yes |
disabled | disabled | boolean | false | Yes |
softDisabled | soft-disabled | boolean | false | Yes |
required | required | boolean | false | Yes |
name | name | string | '' | — |
value | value | string | 'on' | — |
density | density | 0 | -1 | -2 | -3 | -4 | 0 | Yes |
| Method | Parameters |
|---|---|
getValidity() | none |
checkValidity() | none |
reportValidity() | none |
setCustomValidity() | message: string |
Override on the host element for per-instance theming:
| Property | Description |
|---|---|
--md-checkbox-container-color | Unchecked container (transparent) |
--md-checkbox-selected-container-color | Checked / indeterminate fill |
--md-checkbox-outline-color | Border color (unchecked) |
--md-checkbox-outline-width | Border width |
--md-checkbox-icon-color | Checkmark / dash color |
--md-checkbox-container-shape | Container corner radius |
--md-checkbox-container-size | Container size |
--md-checkbox-icon-size | Icon size |
--md-checkbox-state-layer-size | State-layer diameter |
--md-checkbox-state-layer-color | State-layer color (unchecked) |
--md-checkbox-selected-state-layer-color | State-layer color (checked/indeterminate) |
--md-checkbox-touch-target-size | — |
--md-checkbox-supporting-text-color | — |
--md-checkbox-error-text-color | — |
Style internal elements through shadow DOM with ::part():
| Part | Description |
|---|---|
target | — |
state-layer | Hover / focus / press overlay |
container | The 18px checkbox box |
icon | The SVG icon (checkmark or dash) |
supporting-text | — |
<label> gives both the accessible name and a larger hit target
— the preferred pattern. Otherwise use aria-label or aria-labelledby.aria-checked="mixed" when indeterminate.disabled leaves the tab order; soft-disabled stays focusable.error-text next to the control, not only in a transient
browser balloon.--md-checkbox-touch-target-size raised by 4px per rung — 64px at -4 to
get 48px back.fieldset with a legend, or a container with
role="group" and an aria-label.| Key | Action |
|---|---|
Tab | Focus the checkbox (disabled is skipped, soft-disabled is not) |
Space | Toggle it |
Tab through these four: the soft-disabled SMS row still takes focus so a
screen-reader user can discover the option, the disabled Fax row is skipped
entirely, and the mixed Push row announces as “partially checked” until the
first Space resolves it.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Notification preferences" style="display:flex;flex-direction:column;gap:8px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Email</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Push (some channels)</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox soft-disabled></md-checkbox> SMS — unavailable on your plan</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox disabled></md-checkbox> Fax — skipped by Tab</label>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<div role="group" aria-label="Notification preferences" style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox checked></MdCheckbox> Email</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> Push (some channels)</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox soft-disabled></MdCheckbox> SMS — unavailable on your plan</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox disabled></MdCheckbox> Fax — skipped by Tab</label>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div role="group" aria-label="Notification preferences" style="display:flex;flex-direction:column;gap:8px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Email</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Push (some channels)</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox soft-disabled></md-checkbox> SMS — unavailable on your plan</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox disabled></md-checkbox> Fax — skipped by Tab</label>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div role="group" aria-label="Notification preferences" style="display:flex;flex-direction:column;gap:8px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Email</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Push (some channels)</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox soft-disabled></md-checkbox> SMS — unavailable on your plan</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox disabled></md-checkbox> Fax — skipped by Tab</label>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div role="group" aria-label="Notification preferences" style="display:flex;flex-direction:column;gap:8px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Email</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Push (some channels)</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox soft-disabled></md-checkbox> SMS — unavailable on your plan</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox disabled></md-checkbox> Fax — skipped by Tab</label>
</div>RTL — the box, its state layer and the supporting line are all laid out
with logical properties, so the control flips side with the document direction
on its own. Nothing on md-checkbox needs setting. See
RTL.
<div dir="rtl"> <label><md-checkbox checked></md-checkbox> تذكرني</label></div><!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Remember me</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Partial</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> تذكرني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> جزئي</label>
</div>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>ltr</span>
<div dir="ltr" style={{ display: 'flex', gap: '20px', flexWrap: 'wrap' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox checked></MdCheckbox> Remember me</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> Partial</label>
</div>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>rtl</span>
<div dir="rtl" style={{ display: 'flex', gap: '20px', flexWrap: 'wrap' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox checked></MdCheckbox> تذكرني</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> جزئي</label>
</div>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Remember me</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Partial</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> تذكرني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> جزئي</label>
</div>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Remember me</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Partial</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> تذكرني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> جزئي</label>
</div>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">ltr</span>
<div dir="ltr" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Remember me</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Partial</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">rtl</span>
<div dir="rtl" style="display:flex;gap:20px;flex-wrap:wrap;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> تذكرني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> جزئي</label>
</div>
</div>The component flips itself, but the indent you put on a parent/child tree is
your own CSS — and that is where direction usually breaks. Use
margin-inline-start, not margin-left: under dir="rtl" the physical
property pushes the child away from the end edge, so the child row lines up
flush with its parent instead of stepping in from it.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div dir="rtl" style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-inline-start:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-left:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<div dir="rtl" style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>correct</span>
<div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> تحديد الكل</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px', marginInlineStart: '32px' }}><MdCheckbox checked></MdCheckbox> التحليلات</label>
</div>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>wrong</span>
<div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> تحديد الكل</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px', marginLeft: '32px' }}><MdCheckbox checked></MdCheckbox> التحليلات</label>
</div>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div dir="rtl" style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-inline-start:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-left:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div dir="rtl" style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-inline-start:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-left:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div dir="rtl" style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-inline-start:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<div style="display:flex;flex-direction:column;gap:4px;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> تحديد الكل</label>
<label style="display:inline-flex;align-items:center;gap:8px;margin-left:32px;"><md-checkbox checked></md-checkbox> التحليلات</label>
</div>
</div>density="-1…-4" shrinks the box (18px → 14px, 1px per rung) and the touch
target (48px → 32px, 4px per rung). The state layer is min(40px, target), so
it holds at 40px through rung -2 and only starts shrinking at -3. See
Density.
| Rung | Box | Touch target | State layer |
|---|---|---|---|
0 | 18px | 48px | 40px |
-1 | 17px | 44px | 40px |
-2 | 16px | 40px | 40px |
-3 | 15px | 36px | 36px |
-4 | 14px | 32px | 32px |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="0" checked></md-checkbox><md-checkbox density="0" indeterminate></md-checkbox><md-checkbox density="0"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-1" checked></md-checkbox><md-checkbox density="-1" indeterminate></md-checkbox><md-checkbox density="-1"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-2" checked></md-checkbox><md-checkbox density="-2" indeterminate></md-checkbox><md-checkbox density="-2"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-3" checked></md-checkbox><md-checkbox density="-3" indeterminate></md-checkbox><md-checkbox density="-3"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-4" checked></md-checkbox><md-checkbox density="-4" indeterminate></md-checkbox><md-checkbox density="-4"></md-checkbox></div>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center' }}>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>0</span>
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}><MdCheckbox density="0" checked></MdCheckbox><MdCheckbox density="0" indeterminate></MdCheckbox><MdCheckbox density="0"></MdCheckbox></div>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-1</span>
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}><MdCheckbox density="-1" checked></MdCheckbox><MdCheckbox density="-1" indeterminate></MdCheckbox><MdCheckbox density="-1"></MdCheckbox></div>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-2</span>
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}><MdCheckbox density="-2" checked></MdCheckbox><MdCheckbox density="-2" indeterminate></MdCheckbox><MdCheckbox density="-2"></MdCheckbox></div>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-3</span>
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}><MdCheckbox density="-3" checked></MdCheckbox><MdCheckbox density="-3" indeterminate></MdCheckbox><MdCheckbox density="-3"></MdCheckbox></div>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-4</span>
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}><MdCheckbox density="-4" checked></MdCheckbox><MdCheckbox density="-4" indeterminate></MdCheckbox><MdCheckbox density="-4"></MdCheckbox></div>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="0" checked></md-checkbox><md-checkbox density="0" indeterminate></md-checkbox><md-checkbox density="0"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-1" checked></md-checkbox><md-checkbox density="-1" indeterminate></md-checkbox><md-checkbox density="-1"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-2" checked></md-checkbox><md-checkbox density="-2" indeterminate></md-checkbox><md-checkbox density="-2"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-3" checked></md-checkbox><md-checkbox density="-3" indeterminate></md-checkbox><md-checkbox density="-3"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-4" checked></md-checkbox><md-checkbox density="-4" indeterminate></md-checkbox><md-checkbox density="-4"></md-checkbox></div>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="0" checked></md-checkbox><md-checkbox density="0" indeterminate></md-checkbox><md-checkbox density="0"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-1" checked></md-checkbox><md-checkbox density="-1" indeterminate></md-checkbox><md-checkbox density="-1"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-2" checked></md-checkbox><md-checkbox density="-2" indeterminate></md-checkbox><md-checkbox density="-2"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-3" checked></md-checkbox><md-checkbox density="-3" indeterminate></md-checkbox><md-checkbox density="-3"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-4" checked></md-checkbox><md-checkbox density="-4" indeterminate></md-checkbox><md-checkbox density="-4"></md-checkbox></div>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="0" checked></md-checkbox><md-checkbox density="0" indeterminate></md-checkbox><md-checkbox density="0"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-1" checked></md-checkbox><md-checkbox density="-1" indeterminate></md-checkbox><md-checkbox density="-1"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-2" checked></md-checkbox><md-checkbox density="-2" indeterminate></md-checkbox><md-checkbox density="-2"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-3" checked></md-checkbox><md-checkbox density="-3" indeterminate></md-checkbox><md-checkbox density="-3"></md-checkbox></div>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<div style="display:flex;gap:16px;align-items:center;"><md-checkbox density="-4" checked></md-checkbox><md-checkbox density="-4" indeterminate></md-checkbox><md-checkbox density="-4"></md-checkbox></div>
</div>A global data-density ancestor and a local density prop drive the same
signal — --md-sys-density-scale — and the prop lands directly on the host, so
a local rung wins over the inherited one, including inside an RTL subtree.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div dir="rtl" data-density="-2" style="display:flex;flex-direction:column;gap:8px;inline-size:100%;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> بريد إلكتروني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> إشعارات</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox density="-4" checked></md-checkbox> رسائل قصيرة — density="-4"</label>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<div dir="rtl" data-density="-2" style={{ display: 'flex', flexDirection: 'column', gap: '8px', inlineSize: '100%' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox checked></MdCheckbox> بريد إلكتروني</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> إشعارات</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox density="-4" checked></MdCheckbox> رسائل قصيرة — density="-4"</label>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div dir="rtl" data-density="-2" style="display:flex;flex-direction:column;gap:8px;inline-size:100%;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> بريد إلكتروني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> إشعارات</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox density="-4" checked></md-checkbox> رسائل قصيرة — density="-4"</label>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div dir="rtl" data-density="-2" style="display:flex;flex-direction:column;gap:8px;inline-size:100%;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> بريد إلكتروني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> إشعارات</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox density="-4" checked></md-checkbox> رسائل قصيرة — density="-4"</label>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div dir="rtl" data-density="-2" style="display:flex;flex-direction:column;gap:8px;inline-size:100%;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> بريد إلكتروني</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> إشعارات</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox density="-4" checked></md-checkbox> رسائل قصيرة — density="-4"</label>
</div>Density — the box and the touch target taper on every rung; the state layer
is clamped by the target (min(40px, target)) so it only starts moving at -3.
--md-checkbox-container-size and --md-checkbox-icon-size are independent
properties that merely share the same density-derived default, so overriding one
by hand does not move the other — set both together, as the Theming demo below
does.
i18n — translate supporting-text, error-text, value-missing-label and
the visible label text. A hardcoded English value-missing-label in a
localized app is the usual oversight; it is a prop precisely so you can feed it
from your dictionary.
| Custom property | Purpose | Default |
|---|---|---|
--md-checkbox-container-color / --md-checkbox-selected-container-color | Box fill, unselected / selected | Transparent / primary |
--md-checkbox-outline-color / --md-checkbox-outline-width | Box border | on-surface-variant / 2px |
--md-checkbox-icon-color / --md-checkbox-icon-size | Checkmark and dash | on-primary |
--md-checkbox-container-shape / --md-checkbox-container-size | Box radius and size | 2px / 18px |
--md-checkbox-state-layer-size / -color / --md-checkbox-selected-state-layer-color | Hover/press overlay | 40px |
--md-checkbox-touch-target-size | Base hit area, before density trims it | 48px |
--md-checkbox-supporting-text-color / --md-checkbox-error-text-color | Message line | on-surface-variant / error |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-selected-container-color: var(--md-sys-color-tertiary); --md-checkbox-container-shape: 999px;"></md-checkbox> Round and tertiary
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-container-size: 24px; --md-checkbox-icon-size: 22px;"></md-checkbox> Larger box
</label>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox checked style={{ '--md-checkbox-selected-container-color': 'var(--md-sys-color-tertiary)', '--md-checkbox-container-shape': '999px' }}></MdCheckbox> Round and tertiary
</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}>
<MdCheckbox checked style={{ '--md-checkbox-container-size': '24px', '--md-checkbox-icon-size': '22px' }}></MdCheckbox> Larger box
</label>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-selected-container-color: var(--md-sys-color-tertiary); --md-checkbox-container-shape: 999px;"></md-checkbox> Round and tertiary
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-container-size: 24px; --md-checkbox-icon-size: 22px;"></md-checkbox> Larger box
</label><script setup>
import '@awc-ui/core/define';
</script>
<template>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-selected-container-color: var(--md-sys-color-tertiary); --md-checkbox-container-shape: 999px;"></md-checkbox> Round and tertiary
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-container-size: 24px; --md-checkbox-icon-size: 22px;"></md-checkbox> Larger box
</label>
</template><script>
import '@awc-ui/core/define';
</script>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-selected-container-color: var(--md-sys-color-tertiary); --md-checkbox-container-shape: 999px;"></md-checkbox> Round and tertiary
</label>
<label style="display: inline-flex; align-items: center; gap: 8px;">
<md-checkbox checked style="--md-checkbox-container-size: 24px; --md-checkbox-icon-size: 22px;"></md-checkbox> Larger box
</label>Every default resolves through an md-sys-color role, so a checkbox that sets
no custom properties follows the theme on its own:
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:flex;gap:20px;flex-wrap:wrap;align-items:center;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Checked</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Mixed</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox></md-checkbox> Unchecked</label>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'flex', gap: '20px', flexWrap: 'wrap', alignItems: 'center' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox checked></MdCheckbox> Checked</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox indeterminate></MdCheckbox> Mixed</label>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox></MdCheckbox> Unchecked</label>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:flex;gap:20px;flex-wrap:wrap;align-items:center;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Checked</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Mixed</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox></md-checkbox> Unchecked</label>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div style="display:flex;gap:20px;flex-wrap:wrap;align-items:center;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Checked</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Mixed</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox></md-checkbox> Unchecked</label>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div style="display:flex;gap:20px;flex-wrap:wrap;align-items:center;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox checked></md-checkbox> Checked</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox indeterminate></md-checkbox> Mixed</label>
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox></md-checkbox> Unchecked</label>
</div>| Part | Element |
|---|---|
target | The hit area — 48px at density 0, 32px at -4 |
state-layer | Hover / focus / press overlay |
container | The box itself |
icon | The mark — a Material Symbols glyph, not an SVG |
supporting-text | The message line under the control |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<style>
.parts-cb::part(container) { border-radius: 999px; }
.parts-cb::part(icon) { transform: scale(1.15); }
.parts-cb::part(state-layer) { background: var(--md-sys-color-tertiary); }
.parts-cb::part(supporting-text) { font-style: italic; letter-spacing: .02em; }
</style>
<div style="display:flex;gap:24px;flex-wrap:wrap;align-items:flex-start;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox class="parts-cb" checked></md-checkbox> Round box</label>
<md-checkbox class="parts-cb" checked supporting-text="Styled supporting text" aria-label="With supporting text"></md-checkbox>
</div>import { MdCheckbox } from '@awc-ui/react';
export function Demo() {
return (
<>
<style>
.parts-cb::part(container) { border-radius: 999px; }
.parts-cb::part(icon) { transform: scale(1.15); }
.parts-cb::part(state-layer) { background: var(--md-sys-color-tertiary); }
.parts-cb::part(supporting-text) { font-style: italic; letter-spacing: .02em; }
</style>
<div style={{ display: 'flex', gap: '24px', flexWrap: 'wrap', alignItems: 'flex-start' }}>
<label style={{ display: 'inline-flex', alignItems: 'center', gap: '8px' }}><MdCheckbox className="parts-cb" checked></MdCheckbox> Round box</label>
<MdCheckbox className="parts-cb" checked supportingText="Styled supporting text" aria-label="With supporting text"></MdCheckbox>
</div>
</>
);
}// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<style>
.parts-cb::part(container) { border-radius: 999px; }
.parts-cb::part(icon) { transform: scale(1.15); }
.parts-cb::part(state-layer) { background: var(--md-sys-color-tertiary); }
.parts-cb::part(supporting-text) { font-style: italic; letter-spacing: .02em; }
</style>
<div style="display:flex;gap:24px;flex-wrap:wrap;align-items:flex-start;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox class="parts-cb" checked></md-checkbox> Round box</label>
<md-checkbox class="parts-cb" checked supporting-text="Styled supporting text" aria-label="With supporting text"></md-checkbox>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<style>
.parts-cb::part(container) { border-radius: 999px; }
.parts-cb::part(icon) { transform: scale(1.15); }
.parts-cb::part(state-layer) { background: var(--md-sys-color-tertiary); }
.parts-cb::part(supporting-text) { font-style: italic; letter-spacing: .02em; }
</style>
<div style="display:flex;gap:24px;flex-wrap:wrap;align-items:flex-start;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox class="parts-cb" checked></md-checkbox> Round box</label>
<md-checkbox class="parts-cb" checked supporting-text="Styled supporting text" aria-label="With supporting text"></md-checkbox>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<style>
.parts-cb::part(container) { border-radius: 999px; }
.parts-cb::part(icon) { transform: scale(1.15); }
.parts-cb::part(state-layer) { background: var(--md-sys-color-tertiary); }
.parts-cb::part(supporting-text) { font-style: italic; letter-spacing: .02em; }
</style>
<div style="display:flex;gap:24px;flex-wrap:wrap;align-items:flex-start;">
<label style="display:inline-flex;align-items:center;gap:8px;"><md-checkbox class="parts-cb" checked></md-checkbox> Round box</label>
<md-checkbox class="parts-cb" checked supporting-text="Styled supporting text" aria-label="With supporting text"></md-checkbox>
</div>md-checkbox::part(supporting-text) { font-style: italic;}md-radio ·
md-switch ·
md-multi-select ·
md-transfer-list ·
md-chip ·
md-ripple
md-checkboxTwo artefacts to give your AI agent so it generates correct UI with this component. The per-component spec answers "how do I use this exact tag?". The main-llm spec answers "which tag should I pick in the first place?".
md-checkbox spec card
Identity · when to use / when NOT · decision cues · behavioural contract · do/don't · anti-patterns · full API. Paste into your agent when you're implementing with this component.
System-prompt preamble · decision matrix · token reference · page recipes · anti-patterns. Paste into the system prompt at the start of a piece of work.