Skip to content

Date Field ​

States

Loading...

— move between segments - Backspace / Delete — clear the current segment - Escape / a — clear all segments

  • Tag: <flint-date-field>
  • Class: FlintDateField
  • Form Associated: Yes

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintDateField } from 'flint-ui';

Usage ​

html
<flint-date-field></flint-date-field>

Properties ​

PropertyAttributeTypeDefaultDescription
valuevaluestring''Opts the element into form participation via the Form-Associated Custom Elements API. / static formAssociated = true; static styles = unsafeCSS(uiDateFieldStyles); // ── Props ──────────────────────────────────────────────────────────────── /* Controlled date value (ISO YYYY-MM-DD). Set to '' for uncontrolled.
labellabelstring''Field label.
namenamestring''Form field name. Reflected so the browser picks it up for form data collection.
minminstring''Minimum allowed date (ISO).
maxmaxstring''Maximum allowed date (ISO).
disableddisabledbooleanfalseDisables the field and prevents interaction.
readonlyreadonlybooleanfalseMakes the field read-only (visible but not editable).
errorerrorbooleanfalseDisplays the field in an error state.
helperTexthelper-textstring''Helper text shown below the field.

Events ​

EventDetailDescription
flint-date-field-change—{ detail: { value: string } } ISO date when all three segments are filled
flint-date-field-clear—Fired when all segments are cleared

CSS Custom Properties ​

PropertyDefault
--flint-font-family—
--flint-text-color-muted—
--flint-error-color—
--flint-primary-color—
--flint-input-bg—
--flint-border-color—
--flint-border-radius-md—
--flint-primary-focus-ring—
--flint-error-focus-ring—
--flint-input-disabled-bg—
--flint-text-color—
--flint-input-placeholder-color—
--flint-text-color-on-primary—
--flint-hover-color—

Methods ​

MethodDescription
clear()Clears all three segments and fires 'flint-date-field-clear'.