Expand description
DateEdit — text input + calendar popover, bound to Signal<Option<Date>>.
A single-line editable date field. The underlying surface is a
TextInputField displaying the formatted date; commit on Enter or
blur parses the input against the active pattern, clamps to
[min_date, max_date], and writes the result back. A trailing
calendar-icon button opens a Calendar
popover anchored below the field for graphical date selection.
§Behaviour
- Value binding:
Signal<Option<Date>>is the source of truth. External writes re-format the text.Noneshows the placeholder. - Pattern: locale-derived strftime-subset (
%Y-%m-%d,%m/%d/%Y, …); override viaformat_pattern. - Step keys (preview-pass on the field):
- Arrow Up / Down → ±1 day; Shift+ → ±7 days.
- Page Up / Page Down → ±1 month; Shift+ → ±1 year.
Alt+ArrowDown(or click the calendar icon) → opens calendar popover.
- Calendar popover: dismisses on click-outside or Escape,
commits on cell click, animates with
motion.duration_fastfade. - Min / Max: clamps on commit and on step. Out-of-range values in the popover cell are disabled.
§Accessibility
- Container —
Role::DateInput,set_valueto ISO selection,set_labelfrom.label()builder,set_placeholderwhen value isNone. - Calendar trigger button —
Role::Buttonwithset_has_popup(HasPopup::Grid)andset_expanded(open). - Internally the editing surface remains a
Role::TextInputfor AT discoverability (so screen readers know it accepts text); the wrapper carries the DateInput role on the outer node.
§Example
ⓘ
use teksilo::widgets::{DateEdit, common::datetime::Date};
let date = ctx.signal(Some(Date::constant(2026, 5, 2)));
ctx.add(
DateEdit::new(date.clone())
.min_date(Date::constant(2020, 1, 1))
.max_date(Date::constant(2030, 12, 31))
.label("Birth date"),
);Structs§
- Date
Edit - Single-line date input with optional calendar popover. See the module docs for the full feature list.
Enums§
- Validation
Behavior - How the date editor reacts to out-of-range or partially invalid input.
- Width
Policy - How a datetime widget claims horizontal space.