md-time-picker 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.
Choose a time, by dial or by typing. 12h/24h display, min/max bounds
with templated validation messages, and full constraint validation through
ElementInternals.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker label="Start time" value="09:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="17:45"></md-time-picker>
<md-time-picker label="Dial first" variant="dial" value="12:15"></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker label="Start time" value="09:30"></MdTimePicker>
<MdTimePicker label="24-hour" format="24h" value="17:45"></MdTimePicker>
<MdTimePicker label="Dial first" variant="dial" value="12:15"></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker label="Start time" value="09:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="17:45"></md-time-picker>
<md-time-picker label="Dial first" variant="dial" value="12:15"></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker label="Start time" value="09:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="17:45"></md-time-picker>
<md-time-picker label="Dial first" variant="dial" value="12:15"></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker label="Start time" value="09:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="17:45"></md-time-picker>
<md-time-picker label="Dial first" variant="dial" value="12:15"></md-time-picker>
Already installed? See the
Installation guide for one-time package setup
(core + tokens, fonts). Each tab below shows two patterns for using
md-time-picker 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-time-picker) ─── -->
<script type="module">
import '@awc-ui/core/components/md-time-picker';
</script>
<md-time-picker></md-time-picker>// ─── 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 { MdTimePicker } from '@awc-ui/react';
export function Example() {
return <MdTimePicker></MdTimePicker>;
}
// ─── Option B: single import (tree-shake to only md-time-picker) ───
// 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-time-picker';
export function ExampleTreeShaken() {
return <md-time-picker></md-time-picker>;
}// ─── 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-time-picker></md-time-picker>`,
})
export class ExampleComponent {}
// ─── Option B: typed directive (tree-shake friendly) ───
// Pair with `import '@awc-ui/core/components/md-time-picker'` in main.ts.
import { Component } from '@angular/core';
import { MdTimePicker } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [MdTimePicker],
template: `<md-time-picker></md-time-picker>`,
})
export class ExampleTreeShakenComponent {}<!-- ─── Option A: typed Vue wrapper (registers all components) ─── -->
<script setup lang="ts">
import { MdTimePicker } from '@awc-ui/vue';
</script>
<template>
<MdTimePicker></MdTimePicker>
</template>
<!-- ─── Option B: single import (tree-shake to only md-time-picker) ─── -->
<script setup lang="ts">
import '@awc-ui/core/components/md-time-picker';
</script>
<template>
<md-time-picker></md-time-picker>
</template><!-- ─── Option A: global registration (done once in main entry) ─── -->
<!-- main.ts: -->
<!-- import { defineCustomElements } from '@awc-ui/svelte'; -->
<!-- defineCustomElements(window); -->
<md-time-picker></md-time-picker>
<!-- ─── Option B: single import (tree-shake to only md-time-picker) ─── -->
<script lang="ts">
import '@awc-ui/core/components/md-time-picker';
</script>
<md-time-picker></md-time-picker>minute-step="5" / "15").| Situation | Use instead |
|---|---|
| A date | md-date-picker |
| A duration (“90 minutes”) | md-text-field type="number" / md-select |
| A time range | Two pickers with min/max wired to each other |
| A few fixed slots | md-select / md-chip |
| A timestamp the user shouldn’t edit | Formatted text |
| Timezone selection | md-select |
| Need | Setting |
|---|---|
| Typed entry | variant="input" |
| A clock face | variant="dial" |
| Wide layout for landscape | variant="dial-landscape" |
| Pick by viewport | variant="responsive" |
| 12- or 24-hour | format |
| Coarser minutes | minute-step |
| Restrict the range | min / max |
| No built-in trigger | hide-trigger + show() |
| Need | Setting |
|---|---|
| Keyboard entry first (default) | variant="input" |
| Clock dial first | variant="dial" |
| Adapt to viewport | responsive |
| Landscape dial | orientation="horizontal" |
| AM/PM side by side | period-layout="horizontal" |
Prefer variant="input" as the default: typing is faster and more accessible
than dragging a dial for most users. Either way both modes stay reachable — the
dialog carries a toggle in its footer.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker label="Input variant" variant="input" value="08:00"></md-time-picker>
<md-time-picker label="Dial variant" variant="dial" value="08:00"></md-time-picker>
<md-time-picker label="Dial, landscape" variant="dial" orientation="horizontal" value="08:00"></md-time-picker>
<md-time-picker label="Responsive" responsive value="08:00"></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker label="Input variant" variant="input" value="08:00"></MdTimePicker>
<MdTimePicker label="Dial variant" variant="dial" value="08:00"></MdTimePicker>
<MdTimePicker label="Dial, landscape" variant="dial" orientation="horizontal" value="08:00"></MdTimePicker>
<MdTimePicker label="Responsive" responsive value="08:00"></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker label="Input variant" variant="input" value="08:00"></md-time-picker>
<md-time-picker label="Dial variant" variant="dial" value="08:00"></md-time-picker>
<md-time-picker label="Dial, landscape" variant="dial" orientation="horizontal" value="08:00"></md-time-picker>
<md-time-picker label="Responsive" responsive value="08:00"></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker label="Input variant" variant="input" value="08:00"></md-time-picker>
<md-time-picker label="Dial variant" variant="dial" value="08:00"></md-time-picker>
<md-time-picker label="Dial, landscape" variant="dial" orientation="horizontal" value="08:00"></md-time-picker>
<md-time-picker label="Responsive" responsive value="08:00"></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker label="Input variant" variant="input" value="08:00"></md-time-picker>
<md-time-picker label="Dial variant" variant="dial" value="08:00"></md-time-picker>
<md-time-picker label="Dial, landscape" variant="dial" orientation="horizontal" value="08:00"></md-time-picker>
<md-time-picker label="Responsive" responsive value="08:00"></md-time-picker>format="12h" is the default and shows an AM/PM toggle; format="24h" drops
it. Set it from the user’s locale convention — do not hardcode 12h.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker label="12-hour (default)" format="12h" value="14:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="14:30"></md-time-picker>
<md-time-picker label="12h, horizontal AM/PM" format="12h" period-layout="horizontal" value="14:30"></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker label="12-hour (default)" format="12h" value="14:30"></MdTimePicker>
<MdTimePicker label="24-hour" format="24h" value="14:30"></MdTimePicker>
<MdTimePicker label="12h, horizontal AM/PM" format="12h" periodLayout="horizontal" value="14:30"></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker label="12-hour (default)" format="12h" value="14:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="14:30"></md-time-picker>
<md-time-picker label="12h, horizontal AM/PM" format="12h" period-layout="horizontal" value="14:30"></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker label="12-hour (default)" format="12h" value="14:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="14:30"></md-time-picker>
<md-time-picker label="12h, horizontal AM/PM" format="12h" period-layout="horizontal" value="14:30"></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker label="12-hour (default)" format="12h" value="14:30"></md-time-picker>
<md-time-picker label="24-hour" format="24h" value="14:30"></md-time-picker>
<md-time-picker label="12h, horizontal AM/PM" format="12h" period-layout="horizontal" value="14:30"></md-time-picker>minute-step snaps the dial and the entry field to real granularity. Offering
minute precision for hour-long slots is needless precision.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker label="Every minute (default)" variant="dial" value="10:07"></md-time-picker>
<md-time-picker label="Every 5 minutes" variant="dial" minute-step="5" value="10:05"></md-time-picker>
<md-time-picker label="Every 15 minutes" variant="dial" minute-step="15" value="10:15"></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker label="Every minute (default)" variant="dial" value="10:07"></MdTimePicker>
<MdTimePicker label="Every 5 minutes" variant="dial" minuteStep="5" value="10:05"></MdTimePicker>
<MdTimePicker label="Every 15 minutes" variant="dial" minuteStep="15" value="10:15"></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker label="Every minute (default)" variant="dial" value="10:07"></md-time-picker>
<md-time-picker label="Every 5 minutes" variant="dial" minute-step="5" value="10:05"></md-time-picker>
<md-time-picker label="Every 15 minutes" variant="dial" minute-step="15" value="10:15"></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker label="Every minute (default)" variant="dial" value="10:07"></md-time-picker>
<md-time-picker label="Every 5 minutes" variant="dial" minute-step="5" value="10:05"></md-time-picker>
<md-time-picker label="Every 15 minutes" variant="dial" minute-step="15" value="10:15"></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker label="Every minute (default)" variant="dial" value="10:07"></md-time-picker>
<md-time-picker label="Every 5 minutes" variant="dial" minute-step="5" value="10:05"></md-time-picker>
<md-time-picker label="Every 15 minutes" variant="dial" minute-step="15" value="10:15"></md-time-picker>min/max bound the range, required demands a value, and the messages are
templates: {min} and {max} interpolate. Keep those tokens when
translating or the message loses the values it exists to state.
| Prop | Message shown when |
|---|---|
value-missing-label | required and nothing chosen |
range-underflow-label | Before min |
range-overflow-label | After max |
range-outside-label | Outside a wrapping range (min later than max) |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker
label="Office hours"
name="start"
format="24h"
min="09:00"
max="17:00"
minute-step="15"
required
value="09:30"
range-underflow-label="Please choose a time at or after {min}."
range-overflow-label="Please choose a time at or before {max}."
value-missing-label="Please select a time."
></md-time-picker>
<md-time-picker label="Overnight shift" format="24h" min="22:00" max="06:00" value="23:00"
range-outside-label="Please choose a time at or after {min} or at or before {max}."></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker
label="Office hours"
name="start"
format="24h"
min="09:00"
max="17:00"
minuteStep="15"
required
value="09:30"
rangeUnderflowLabel="Please choose a time at or after {min}."
rangeOverflowLabel="Please choose a time at or before {max}."
valueMissingLabel="Please select a time."
></MdTimePicker>
<MdTimePicker label="Overnight shift" format="24h" min="22:00" max="06:00" value="23:00"
rangeOutsideLabel="Please choose a time at or after {min} or at or before {max}."></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker
label="Office hours"
name="start"
format="24h"
min="09:00"
max="17:00"
minute-step="15"
required
value="09:30"
range-underflow-label="Please choose a time at or after {min}."
range-overflow-label="Please choose a time at or before {max}."
value-missing-label="Please select a time."
></md-time-picker>
<md-time-picker label="Overnight shift" format="24h" min="22:00" max="06:00" value="23:00"
range-outside-label="Please choose a time at or after {min} or at or before {max}."></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker
label="Office hours"
name="start"
format="24h"
min="09:00"
max="17:00"
minute-step="15"
required
value="09:30"
range-underflow-label="Please choose a time at or after {min}."
range-overflow-label="Please choose a time at or before {max}."
value-missing-label="Please select a time."
></md-time-picker>
<md-time-picker label="Overnight shift" format="24h" min="22:00" max="06:00" value="23:00"
range-outside-label="Please choose a time at or after {min} or at or before {max}."></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker
label="Office hours"
name="start"
format="24h"
min="09:00"
max="17:00"
minute-step="15"
required
value="09:30"
range-underflow-label="Please choose a time at or after {min}."
range-overflow-label="Please choose a time at or before {max}."
value-missing-label="Please select a time."
></md-time-picker>
<md-time-picker label="Overnight shift" format="24h" min="22:00" max="06:00" value="23:00"
range-outside-label="Please choose a time at or after {min} or at or before {max}."></md-time-picker><!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker label="Enabled" value="09:00"></md-time-picker>
<md-time-picker label="Disabled" value="09:00" disabled></md-time-picker>
<md-time-picker label="Required, empty" required></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker label="Enabled" value="09:00"></MdTimePicker>
<MdTimePicker label="Disabled" value="09:00" disabled></MdTimePicker>
<MdTimePicker label="Required, empty" required></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker label="Enabled" value="09:00"></md-time-picker>
<md-time-picker label="Disabled" value="09:00" disabled></md-time-picker>
<md-time-picker label="Required, empty" required></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker label="Enabled" value="09:00"></md-time-picker>
<md-time-picker label="Disabled" value="09:00" disabled></md-time-picker>
<md-time-picker label="Required, empty" required></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker label="Enabled" value="09:00"></md-time-picker>
<md-time-picker label="Disabled" value="09:00" disabled></md-time-picker>
<md-time-picker label="Required, empty" required></md-time-picker>hide-trigger renders the picker without its own field, for embedding in your
own layout. You call show() — and hide() to close it, not close().
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-button id="tp-open" variant="filled" icon="schedule">Pick a time</md-button>
<md-time-picker id="tp" hide-trigger format="24h" minute-step="5"></md-time-picker>
<script type="module">
const picker = document.getElementById('tp');
document.getElementById('tp-open')
.addEventListener('mdClick', () => picker.show());
picker.addEventListener('mdChange', () => console.log(picker.value));
// close it with hide(), not close()
</script>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { useEffect, useRef } from 'react';
import { MdButton, MdTimePicker } from '@awc-ui/react';
export function Demo() {
const pickerRef = useRef(null);
useEffect(() => {
const picker = pickerRef.current;
document.getElementById('tp-open')
.addEventListener('mdClick', () => picker.show());
picker.addEventListener('mdChange', () => console.log(picker.value));
// close it with hide(), not close()
}, []);
return (
<>
<MdButton id="tp-open" variant="filled" icon="schedule">Pick a time</MdButton>
<MdTimePicker id="tp" ref={pickerRef} hideTrigger format="24h" minuteStep="5"></MdTimePicker>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// 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.ts
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-demo',
templateUrl: './app.component.html',
})
export class DemoComponent implements AfterViewInit {
@ViewChild('picker') pickerRef!: ElementRef;
ngAfterViewInit() {
const picker = this.pickerRef.nativeElement;
document.getElementById('tp-open')
.addEventListener('mdClick', () => picker.show());
picker.addEventListener('mdChange', () => console.log(picker.value));
// close it with hide(), not close()
}
}
<!-- app.component.html -->
<md-button id="tp-open" variant="filled" icon="schedule">Pick a time</md-button>
<md-time-picker id="tp" #picker hide-trigger format="24h" minute-step="5"></md-time-picker><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { onMounted, ref } from 'vue';
import '@awc-ui/core/define';
const pickerRef = ref(null);
onMounted(() => {
const picker = pickerRef.value;
document.getElementById('tp-open')
.addEventListener('mdClick', () => picker.show());
picker.addEventListener('mdChange', () => console.log(picker.value));
// close it with hide(), not close()
});
</script>
<template>
<md-button id="tp-open" variant="filled" icon="schedule">Pick a time</md-button>
<md-time-picker id="tp" ref="pickerRef" hide-trigger format="24h" minute-step="5"></md-time-picker>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { onMount } from 'svelte';
import '@awc-ui/core/define';
let pickerRef;
onMount(() => {
const picker = pickerRef;
document.getElementById('tp-open')
.addEventListener('mdClick', () => picker.show());
picker.addEventListener('mdChange', () => console.log(picker.value));
// close it with hide(), not close()
});
</script>
<md-button id="tp-open" variant="filled" icon="schedule">Pick a time</md-button>
<md-time-picker id="tp" bind:this={pickerRef} hide-trigger format="24h" minute-step="5"></md-time-picker>| Event | Cancelable | Detail | Fires |
|---|---|---|---|
mdChange | no | MdTimePickerChangeDetail | A time is committed |
mdInput | no | MdTimePickerChangeDetail | During entry — do not wire a save to this |
mdOpen / mdClose | no | void | The dialog opens / closes |
mdCancel | no | void | The dialog is dismissed |
mdModeChange | no | dial ⇄ input | The footer mode toggle is used |
mdValidityChange | no | { valid, validationMessage, flags } | Validity is recomputed |
<md-time-picker id="start" label="Start time" name="start"
format="24h" min="09:00" max="17:00" minute-step="15" required
range-underflow-label="Please choose a time at or after {min}."
range-overflow-label="Please choose a time at or before {max}."
></md-time-picker>
<script type="module">
const t = document.getElementById('start');
t.addEventListener('mdChange', (e) => save(e.detail)); // value stays "HH:MM"
t.addEventListener('mdCancel', () => console.log('dismissed'));
t.addEventListener('mdValidityChange', (e) => {
console.log(e.detail.valid, e.detail.validationMessage);
});
</script>import { MdTimePicker } from '@awc-ui/react';
import { useState } from 'react';
export function StartTime() {
const [value, setValue] = useState('09:00');
return (
<MdTimePicker
label="Start time"
name="start"
format="24h"
min="09:00"
max="17:00"
minuteStep={15}
required
value={value}
rangeUnderflowLabel="Please choose a time at or after {min}."
rangeOverflowLabel="Please choose a time at or before {max}."
onMdChange={(e) => setValue(e.detail.value)}
/>
);
}import { Component } from '@angular/core';
@Component({
selector: 'app-start-time',
template: `
<md-time-picker
label="Start time" name="start" format="24h"
min="09:00" max="17:00" minute-step="15" required
[value]="value"
(mdChange)="onChange($event)"
></md-time-picker>
`,
})
export class StartTimeComponent {
value = '09:00';
onChange(e: CustomEvent<{ value: string }>) {
this.value = e.detail.value; // always "HH:MM"
}
}<script setup lang="ts">
import { ref } from 'vue';
const value = ref('09:00');
function onChange(e: CustomEvent) {
value.value = e.detail.value; // always "HH:MM"
}
</script>
<template>
<md-time-picker
label="Start time" name="start" format="24h"
min="09:00" max="17:00" minute-step="15" required
:value="value"
@mdChange="onChange"
/>
</template><script lang="ts">
let value = '09:00';
function onChange(e: CustomEvent) {
value = e.detail.value; // always "HH:MM"
}
</script>
<md-time-picker
label="Start time" name="start" format="24h"
min="09:00" max="17:00" minute-step="15" required
{value}
on:mdChange={onChange}
></md-time-picker>There is no range variant. Two pickers make one by feeding each other’s bounds:
committing the From time becomes the To picker’s min, and vice versa,
so the pair can never end up inverted. Set a time in either one and watch the
other’s bounds tighten.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker id="from" label="From" format="24h" minute-step="15" value="09:00"></md-time-picker>
<md-time-picker id="to" label="To" format="24h" minute-step="15" value="17:00"></md-time-picker>
<script type="module">
const from = document.getElementById('from');
const to = document.getElementById('to');
// Each committed value becomes the other picker's bound, so the pair can
// never invert. mdChange fires on commit — mdInput would fight the user
// mid-edit.
from.addEventListener('mdChange', () => { to.min = from.value; });
to.addEventListener('mdChange', () => { from.max = to.value; });
</script>import { useEffect, useRef } from 'react';
import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
const fromRef = useRef(null);
const toRef = useRef(null);
useEffect(() => {
const from = fromRef.current;
const to = toRef.current;
// Each committed value becomes the other picker's bound, so the pair can
// never invert. mdChange fires on commit — mdInput would fight the user
// mid-edit.
from.addEventListener('mdChange', () => { to.min = from.value; });
to.addEventListener('mdChange', () => { from.max = to.value; });
}, []);
return (
<>
<MdTimePicker id="from" ref={fromRef} label="From" format="24h" minuteStep="15" value="09:00"></MdTimePicker>
<MdTimePicker id="to" ref={toRef} label="To" format="24h" minuteStep="15" value="17:00"></MdTimePicker>
</>
);
}// 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.ts
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-demo',
templateUrl: './app.component.html',
})
export class DemoComponent implements AfterViewInit {
@ViewChild('from') fromRef!: ElementRef;
@ViewChild('to') toRef!: ElementRef;
ngAfterViewInit() {
const from = this.fromRef.nativeElement;
const to = this.toRef.nativeElement;
// Each committed value becomes the other picker's bound, so the pair can
// never invert. mdChange fires on commit — mdInput would fight the user
// mid-edit.
from.addEventListener('mdChange', () => { to.min = from.value; });
to.addEventListener('mdChange', () => { from.max = to.value; });
}
}
<!-- app.component.html -->
<md-time-picker id="from" #from label="From" format="24h" minute-step="15" value="09:00"></md-time-picker>
<md-time-picker id="to" #to label="To" format="24h" minute-step="15" value="17:00"></md-time-picker><script setup>
import { onMounted, ref } from 'vue';
import '@awc-ui/core/define';
const fromRef = ref(null);
const toRef = ref(null);
onMounted(() => {
const from = fromRef.value;
const to = toRef.value;
// Each committed value becomes the other picker's bound, so the pair can
// never invert. mdChange fires on commit — mdInput would fight the user
// mid-edit.
from.addEventListener('mdChange', () => { to.min = from.value; });
to.addEventListener('mdChange', () => { from.max = to.value; });
});
</script>
<template>
<md-time-picker id="from" ref="fromRef" label="From" format="24h" minute-step="15" value="09:00"></md-time-picker>
<md-time-picker id="to" ref="toRef" label="To" format="24h" minute-step="15" value="17:00"></md-time-picker>
</template><script>
import { onMount } from 'svelte';
import '@awc-ui/core/define';
let fromRef;
let toRef;
onMount(() => {
const from = fromRef;
const to = toRef;
// Each committed value becomes the other picker's bound, so the pair can
// never invert. mdChange fires on commit — mdInput would fight the user
// mid-edit.
from.addEventListener('mdChange', () => { to.min = from.value; });
to.addEventListener('mdChange', () => { from.max = to.value; });
});
</script>
<md-time-picker id="from" bind:this={fromRef} label="From" format="24h" minute-step="15" value="09:00"></md-time-picker>
<md-time-picker id="to" bind:this={toRef} label="To" format="24h" minute-step="15" value="17:00"></md-time-picker>Use mdChange, not mdInput: bounds applied mid-edit would fight the user as
they type. Both pickers keep their own validation — a value outside the bound it
was given reports rangeUnderflow / rangeOverflow with the localized
range-underflow-label / range-overflow-label message.
| Property | Attribute | Type | Default | Reflects |
|---|---|---|---|---|
variant | variant | MdTimePickerMode | 'input' | — |
format | format | MdTimePickerFormat | '12h' | — |
value | value | string | '' | Yes |
name | name | string | '' | Yes |
min | min | string | '' | — |
max | max | string | '' | — |
required | required | boolean | false | Yes |
label | label | string | 'Select time' | — |
headline | headline | string | '' | — |
headlineInputLabel | headline-input-label | string | 'Enter time' | — |
headlineDialLabel | headline-dial-label | string | 'Select time' | — |
valueMissingLabel | value-missing-label | string | 'Please select a time.' | — |
rangeUnderflowLabel | range-underflow-label | string | 'Please select a time at or after {min}.' | — |
rangeOverflowLabel | range-overflow-label | string | 'Please select a time at or before {max}.' | — |
rangeOutsideLabel | range-outside-label | string | 'Please select a time at or after {min} or at or before {max}.' | — |
disabled | disabled | boolean | false | Yes |
open | open | boolean | false | Yes |
minuteStep | minute-step | number | 1 | — |
cancelLabel | cancel-label | string | 'Cancel' | — |
okLabel | ok-label | string | 'OK' | — |
hideTrigger | hide-trigger | boolean | false | Yes |
amLabel | am-label | string | 'AM' | — |
pmLabel | pm-label | string | 'PM' | — |
hourLabel | hour-label | string | 'Hour' | — |
minuteLabel | minute-label | string | 'Minute' | — |
toggleDialLabel | toggle-dial-label | string | 'Toggle dial picker' | — |
toggleInputLabel | toggle-input-label | string | 'Toggle keyboard input' | — |
periodLabel | period-label | string | 'Period' | — |
periodLayout | period-layout | MdTimePickerPeriodLayout | 'vertical' | — |
orientation | orientation | MdTimePickerOrientation | 'vertical' | — |
responsive | responsive | boolean | false | — |
density | density | 0 | -1 | -2 | -3 | -4 | 0 | Yes |
| Method | Parameters |
|---|---|
show() | none |
hide() | none |
checkValidity() | none |
reportValidity() | none |
getValidity() | none |
Override on the host element for per-instance theming:
| Property | Description |
|---|---|
--md-time-picker-trigger-color | Trigger label/value color |
--md-time-picker-trigger-outline-color | Trigger outline color |
--md-time-picker-trigger-hover-color | Trigger leading-icon color on hover |
--md-time-picker-trigger-focus-color | Trigger focus indicator color |
--md-time-picker-trigger-icon-color | Trigger leading icon color |
--md-time-picker-dialog-color | Dialog surface color |
--md-time-picker-dialog-on-color | Dialog text color |
--md-time-picker-scrim-color | Modal scrim color (rgba) |
--md-time-picker-headline-color | Headline label color |
--md-time-picker-period-bg | Period (AM/PM) container bg |
--md-time-picker-period-color | Period (AM/PM) text color |
--md-time-picker-period-active-bg | Period selected bg |
--md-time-picker-period-active-color | Period selected color |
--md-time-picker-period-outline-color | Period outline color |
--md-time-picker-period-hover-opacity | Period state-layer opacity on hover (e.g. 8% / 12%) |
--md-time-picker-dial-bg | Dial surface color |
--md-time-picker-dial-number-color | Dial number text color |
--md-time-picker-dial-number-active-color | Selected number color |
--md-time-picker-dial-hand-color | Hand / centre-dot color |
--md-time-picker-input-bg | HH/MM tile bg (inactive) |
--md-time-picker-input-color | HH/MM tile text color (inactive) |
--md-time-picker-input-active-bg | HH/MM tile bg when focused (default = primary-container) |
--md-time-picker-input-active-color | HH/MM tile text when focused (default = on-primary-container) |
--md-time-picker-input-outline-color | HH/MM tile resting outline color (default transparent) |
--md-time-picker-input-error-color | Error outline / hint color |
--md-time-picker-input-hint-color | "Hour" / "Minute" helper-label color |
--md-time-picker-input-separator-color | Colon glyph between HH and MM |
--md-time-picker-input-hover-opacity | HH/MM state-layer opacity (e.g. 8%) |
--md-time-picker-action-color | Cancel label color |
--md-time-picker-action-primary-color | OK label color |
--md-time-picker-action-cancel-bg | Cancel button container color (default transparent — set to apply a tonal/filled style) |
--md-time-picker-action-confirm-bg | OK button container color (default transparent — set to apply a tonal/filled style) |
--md-time-picker-toggle-icon-color | Mode-toggle icon color |
--md-time-picker-toggle-bg | Mode-toggle container color (default transparent) |
--md-time-picker-trigger-shape | Trigger corner-radius (piped onto md-text-field) |
--md-time-picker-dialog-shape | Dialog corner-radius |
--md-time-picker-input-shape | HH/MM tile corner-radius (canonical name; --md-time-picker-time-display-shape kept as back-compat alias) |
--md-time-picker-period-shape | AM/PM container corner-radius |
--md-time-picker-action-shape | Cancel / OK button corner-radius (piped onto md-button) |
--md-time-picker-toggle-shape | Mode-toggle corner-radius (piped onto md-icon-button) |
--md-time-picker-trigger-min-width | Trigger min-inline-size (default 240px) |
--md-time-picker-trigger-icon-size | Trigger leading icon font-size (default 24px, tapers with density) |
--md-time-picker-dialog-padding | Dialog internal padding (default 24px) |
--md-time-picker-dialog-min-width | Dialog width in portrait / input variants (default 328px) |
--md-time-picker-dialog-horizontal-width-12h | Horizontal dial dialog width in 12h mode (default 572px) |
--md-time-picker-dialog-horizontal-width-24h | Horizontal dial dialog width in 24h mode (default 608px) |
--md-time-picker-input-width | HH/MM tile inline-size (default 96px = 4/3 of the height; derived from the font unless set) |
--md-time-picker-input-height | HH/MM tile block-size (default 72px = 1.6 x the font; derived from the font unless set) |
--md-time-picker-input-border-width | HH/MM tile border width (default 2px) |
--md-time-picker-input-separator-width | Colon column width (default 24px) |
--md-time-picker-input-hint-gap | Gap between tile and "Hour" / "Minute" hint (default 4px) |
--md-time-picker-period-outline-width | AM/PM container border width (default 1px) |
--md-time-picker-period-vertical-width | AM/PM vertical-stack width (default 52px) |
--md-time-picker-period-vertical-height | AM/PM vertical-stack height in dial variant (default 80px) |
--md-time-picker-period-vertical-height-input | AM/PM vertical-stack height in input variant (default 72px) |
--md-time-picker-period-horizontal-width | AM/PM horizontal-pill width (default 216px) |
--md-time-picker-period-horizontal-height | AM/PM horizontal-pill height (default 38px) |
--md-time-picker-dial-size | Dial face diameter (default 256px) |
--md-time-picker-dial-target-size | Per-number touch-target diameter (default 48px) |
--md-time-picker-dial-center-size | Centre-dot diameter (default 8px) |
--md-time-picker-dial-hand-width | Hand-line stroke width (default 2px) |
--md-time-picker-hand-length | Hand-line length override (default: computed — 100%, ~62% on the 24h inner ring) |
--md-time-picker-footer-gap | Gap between mode-toggle and actions (default 8px) |
--md-time-picker-actions-gap | Gap between Cancel and OK (default 8px) |
--md-time-picker-toggle-icon-size | Mode-toggle icon font-size (default 24px, tapers with density) |
--md-time-picker-headline-spacing | Margin below headline (default 20px) |
--md-time-picker-headline-font-size | Headline font-size (default label-medium = 12px) |
--md-time-picker-headline-font-weight | Headline font-weight (default 500) |
--md-time-picker-input-font-size | HH/MM tile font-size (default display-medium = 45px) |
--md-time-picker-input-font-weight | HH/MM tile font-weight (default 400) |
--md-time-picker-period-font-size | AM/PM label font-size (default 14px) |
--md-time-picker-period-font-weight | AM/PM label font-weight (default 500) |
--md-time-picker-dial-number-font-size | Dial number font-size (default body-large = 16px) |
--md-time-picker-dial-number-font-weight | Dial number resting font-weight (default 400) |
--md-time-picker-dial-number-active-font-weight | Dial number active font-weight (default 500) |
--md-time-picker-dialog-enter-duration | Dialog open animation duration (default 500ms) |
--md-time-picker-mode-swap-duration | Dial⇄input swap animation duration (default 450ms) |
--md-time-picker-motion-easing | Easing curve shared by both entry animations (default emphasized-decelerate) |
--md-time-picker-dialog-elevation | Dialog box-shadow |
--md-time-picker-time-display-shape | — |
--md-time-picker-input-active-outline-color | — |
Style internal elements through shadow DOM with ::part():
| Part | Description |
|---|---|
period-am | AM button |
period-pm | PM button |
trigger | Composed md-text-field that opens the dialog |
trigger-icon | Schedule icon slotted into trigger's leading slot |
period-toggle | AM/PM toggle group |
period-am-ripple | — |
period-pm-ripple | — |
dial-wrap | Wrapper around the dial (dial variant only) |
dial | Dial surface (drag target; dial variant only) |
dial-hand | Selection hand (dial variant only) |
input-area | Container for the typeable HH/MM input row |
input-hour | HH text input tile |
input-minute | MM text input tile |
time-area | Dial-variant wrapper around input-area + the |
scrim | Modal scrim |
dialog | Dialog surface |
headline | Headline label ("Enter time" / "Select time") |
body | — |
footer | Footer with mode toggle + actions |
toggle-mode | Icon button switching dial<->input |
actions | Action button row (Cancel / OK) |
cancel-button | Cancel button |
confirm-button | OK (confirm) button |
hour-label,
minute-label and period-label are the accessible names of the entry
fields and the AM/PM control.toggle-dial-label / toggle-input-label name the mode switch — translate
them.variant="input" as the default for the reasons above.RTL — the dialog, field order and AM/PM toggle mirror under dir="rtl". The
clock dial itself keeps clockwise numbering — that is not a directional cue. See
RTL.
Density — density="-1…-4" compacts the trigger field. The dialog is
deliberately unaffected: measured across the rungs, the dial keeps a 327px
diameter and its numbers keep 48px hit targets, so a compact form can never
produce a dial you cannot hit. See Density.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;">
<md-time-picker label="Density 0" format="24h" value="09:00" density="0"></md-time-picker>
<md-time-picker label="-1" format="24h" value="09:00" density="-1"></md-time-picker>
<md-time-picker label="-2" format="24h" value="09:00" density="-2"></md-time-picker>
<md-time-picker label="-3" format="24h" value="09:00" density="-3"></md-time-picker>
<md-time-picker label="-4" format="24h" value="09:00" density="-4"></md-time-picker>
</div>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'flex', gap: '16px', alignItems: 'flex-start', flexWrap: 'wrap' }}>
<MdTimePicker label="Density 0" format="24h" value="09:00" density="0"></MdTimePicker>
<MdTimePicker label="-1" format="24h" value="09:00" density="-1"></MdTimePicker>
<MdTimePicker label="-2" format="24h" value="09:00" density="-2"></MdTimePicker>
<MdTimePicker label="-3" format="24h" value="09:00" density="-3"></MdTimePicker>
<MdTimePicker label="-4" format="24h" value="09:00" density="-4"></MdTimePicker>
</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: 16px; align-items: flex-start; flex-wrap: wrap;">
<md-time-picker label="Density 0" format="24h" value="09:00" density="0"></md-time-picker>
<md-time-picker label="-1" format="24h" value="09:00" density="-1"></md-time-picker>
<md-time-picker label="-2" format="24h" value="09:00" density="-2"></md-time-picker>
<md-time-picker label="-3" format="24h" value="09:00" density="-3"></md-time-picker>
<md-time-picker label="-4" format="24h" value="09:00" density="-4"></md-time-picker>
</div><script setup>
import '@awc-ui/core/define';
</script>
<template>
<div style="display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;">
<md-time-picker label="Density 0" format="24h" value="09:00" density="0"></md-time-picker>
<md-time-picker label="-1" format="24h" value="09:00" density="-1"></md-time-picker>
<md-time-picker label="-2" format="24h" value="09:00" density="-2"></md-time-picker>
<md-time-picker label="-3" format="24h" value="09:00" density="-3"></md-time-picker>
<md-time-picker label="-4" format="24h" value="09:00" density="-4"></md-time-picker>
</div>
</template><script>
import '@awc-ui/core/define';
</script>
<div style="display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;">
<md-time-picker label="Density 0" format="24h" value="09:00" density="0"></md-time-picker>
<md-time-picker label="-1" format="24h" value="09:00" density="-1"></md-time-picker>
<md-time-picker label="-2" format="24h" value="09:00" density="-2"></md-time-picker>
<md-time-picker label="-3" format="24h" value="09:00" density="-3"></md-time-picker>
<md-time-picker label="-4" format="24h" value="09:00" density="-4"></md-time-picker>
</div>i18n — every visible string is a prop, all defaulting to English:
label, headline, headline-input-label, headline-dial-label, am-label,
pm-label, hour-label, minute-label, period-label, cancel-label,
ok-label, toggle-dial-label, toggle-input-label, and the four validation
messages. Keep {min} / {max} intact in the range messages, and set format
from the locale’s convention.
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker
label="Heure de début"
format="24h"
value="09:30"
headline-input-label="Saisir l'heure"
headline-dial-label="Sélectionner l'heure"
hour-label="Heure"
minute-label="Minute"
cancel-label="Annuler"
ok-label="Valider"
toggle-dial-label="Basculer vers le cadran"
toggle-input-label="Basculer vers la saisie"
value-missing-label="Veuillez sélectionner une heure."
></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker
label="Heure de début"
format="24h"
value="09:30"
headlineInputLabel="Saisir l'heure"
headlineDialLabel="Sélectionner l'heure"
hourLabel="Heure"
minuteLabel="Minute"
cancelLabel="Annuler"
okLabel="Valider"
toggleDialLabel="Basculer vers le cadran"
toggleInputLabel="Basculer vers la saisie"
valueMissingLabel="Veuillez sélectionner une heure."
></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker
label="Heure de début"
format="24h"
value="09:30"
headline-input-label="Saisir l'heure"
headline-dial-label="Sélectionner l'heure"
hour-label="Heure"
minute-label="Minute"
cancel-label="Annuler"
ok-label="Valider"
toggle-dial-label="Basculer vers le cadran"
toggle-input-label="Basculer vers la saisie"
value-missing-label="Veuillez sélectionner une heure."
></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker
label="Heure de début"
format="24h"
value="09:30"
headline-input-label="Saisir l'heure"
headline-dial-label="Sélectionner l'heure"
hour-label="Heure"
minute-label="Minute"
cancel-label="Annuler"
ok-label="Valider"
toggle-dial-label="Basculer vers le cadran"
toggle-input-label="Basculer vers la saisie"
value-missing-label="Veuillez sélectionner une heure."
></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker
label="Heure de début"
format="24h"
value="09:30"
headline-input-label="Saisir l'heure"
headline-dial-label="Sélectionner l'heure"
hour-label="Heure"
minute-label="Minute"
cancel-label="Annuler"
ok-label="Valider"
toggle-dial-label="Basculer vers le cadran"
toggle-input-label="Basculer vers la saisie"
value-missing-label="Veuillez sélectionner une heure."
></md-time-picker>| Custom property | Purpose |
|---|---|
--md-time-picker-trigger-color / -outline-color / -hover-color / -focus-color | Trigger field |
--md-time-picker-trigger-icon-color | Trigger glyph |
--md-time-picker-dialog-color / -dialog-on-color | Dialog surface |
--md-time-picker-scrim-color | Backdrop |
--md-time-picker-headline-color | Headline |
--md-time-picker-period-bg / -period-active-bg | AM/PM toggle |
--md-time-picker-dial-bg / -dial-hand-color | Clock dial |
--md-time-picker-input-bg / -input-active-bg | Entry fields |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<md-time-picker label="Tertiary accent" value="11:20"
style="--md-time-picker-dial-hand-color: var(--md-sys-color-tertiary); --md-time-picker-headline-color: var(--md-sys-color-tertiary); --md-time-picker-input-active-bg: var(--md-sys-color-tertiary-container);"></md-time-picker>
<md-time-picker label="Squared trigger" value="11:20"
style="--md-time-picker-trigger-shape: 6px; --md-time-picker-dialog-shape: 8px;"></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<MdTimePicker label="Tertiary accent" value="11:20"
style={{ '--md-time-picker-dial-hand-color': 'var(--md-sys-color-tertiary)', '--md-time-picker-headline-color': 'var(--md-sys-color-tertiary)', '--md-time-picker-input-active-bg': 'var(--md-sys-color-tertiary-container)' }}></MdTimePicker>
<MdTimePicker label="Squared trigger" value="11:20"
style={{ '--md-time-picker-trigger-shape': '6px', '--md-time-picker-dialog-shape': '8px' }}></MdTimePicker>
</>
);
}// 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 -->
<md-time-picker label="Tertiary accent" value="11:20"
style="--md-time-picker-dial-hand-color: var(--md-sys-color-tertiary); --md-time-picker-headline-color: var(--md-sys-color-tertiary); --md-time-picker-input-active-bg: var(--md-sys-color-tertiary-container);"></md-time-picker>
<md-time-picker label="Squared trigger" value="11:20"
style="--md-time-picker-trigger-shape: 6px; --md-time-picker-dialog-shape: 8px;"></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<md-time-picker label="Tertiary accent" value="11:20"
style="--md-time-picker-dial-hand-color: var(--md-sys-color-tertiary); --md-time-picker-headline-color: var(--md-sys-color-tertiary); --md-time-picker-input-active-bg: var(--md-sys-color-tertiary-container);"></md-time-picker>
<md-time-picker label="Squared trigger" value="11:20"
style="--md-time-picker-trigger-shape: 6px; --md-time-picker-dialog-shape: 8px;"></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<md-time-picker label="Tertiary accent" value="11:20"
style="--md-time-picker-dial-hand-color: var(--md-sys-color-tertiary); --md-time-picker-headline-color: var(--md-sys-color-tertiary); --md-time-picker-input-active-bg: var(--md-sys-color-tertiary-container);"></md-time-picker>
<md-time-picker label="Squared trigger" value="11:20"
style="--md-time-picker-trigger-shape: 6px; --md-time-picker-dialog-shape: 8px;"></md-time-picker>Every default resolves through an md-sys-color role, so a picker that sets no
custom properties follows the theme on its own.
| Part | Element |
|---|---|
trigger / trigger-icon | The field trigger and its glyph |
scrim / dialog | Modal backdrop and panel |
headline / body / footer | Dialog regions |
dial / dial-hand / dial-wrap | The clock face, its hand, its wrapper |
input-area / input-hour / input-minute | Typed-entry region and its two fields |
time-area | The hour–minute cluster |
period-toggle / period-am / period-pm | AM/PM control and its halves |
toggle-mode | The dial ⇄ input switch |
actions / cancel-button / confirm-button | The action row |
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<style>
.parts-tp::part(trigger-icon) { color: var(--md-sys-color-primary); }
.parts-tp::part(dial-hand) { opacity: .9; }
.parts-tp::part(headline) { font-style: italic; }
.parts-tp::part(confirm-button) { font-weight: 700; }
</style>
<md-time-picker class="parts-tp" label="Styled parts" value="14:30" variant="dial" style="min-inline-size: 240px;"></md-time-picker>import { MdTimePicker } from '@awc-ui/react';
export function Demo() {
return (
<>
<style>
.parts-tp::part(trigger-icon) { color: var(--md-sys-color-primary); }
.parts-tp::part(dial-hand) { opacity: .9; }
.parts-tp::part(headline) { font-style: italic; }
.parts-tp::part(confirm-button) { font-weight: 700; }
</style>
<MdTimePicker className="parts-tp" label="Styled parts" value="14:30" variant="dial" style={{ minInlineSize: '240px' }}></MdTimePicker>
</>
);
}// 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-tp::part(trigger-icon) { color: var(--md-sys-color-primary); }
.parts-tp::part(dial-hand) { opacity: .9; }
.parts-tp::part(headline) { font-style: italic; }
.parts-tp::part(confirm-button) { font-weight: 700; }
</style>
<md-time-picker class="parts-tp" label="Styled parts" value="14:30" variant="dial" style="min-inline-size: 240px;"></md-time-picker><script setup>
import '@awc-ui/core/define';
</script>
<template>
<style>
.parts-tp::part(trigger-icon) { color: var(--md-sys-color-primary); }
.parts-tp::part(dial-hand) { opacity: .9; }
.parts-tp::part(headline) { font-style: italic; }
.parts-tp::part(confirm-button) { font-weight: 700; }
</style>
<md-time-picker class="parts-tp" label="Styled parts" value="14:30" variant="dial" style="min-inline-size: 240px;"></md-time-picker>
</template><script>
import '@awc-ui/core/define';
</script>
<style>
.parts-tp::part(trigger-icon) { color: var(--md-sys-color-primary); }
.parts-tp::part(dial-hand) { opacity: .9; }
.parts-tp::part(headline) { font-style: italic; }
.parts-tp::part(confirm-button) { font-weight: 700; }
</style>
<md-time-picker class="parts-tp" label="Styled parts" value="14:30" variant="dial" style="min-inline-size: 240px;"></md-time-picker>md-time-picker::part(dial-hand) { opacity: 0.9;}md-date-picker ·
md-text-field ·
md-select ·
md-dialog ·
md-icon-button ·
md-button
md-time-pickerTwo 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-time-picker 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.