Skip to content
Elements / Input

date-picker

binds state

A field that opens a month calendar to pick one date, kept in bind= as YYYY-MM-DD text ("" for none), or with range=true a start and an end. For deadlines, bookings or report filters.

Spec · edit me

No problems. The parser accepted every line.

Result · try itOpen in playground
Tweak the props
range
required

Props

"text"textThe label above the field.optional
bindstateState that holds the date as YYYY-MM-DD, like due or t.date. Start it as "" for no date.required
minstringThe earliest date that can be chosen, YYYY-MM-DD, included.—
maxstringThe latest date that can be chosen, YYYY-MM-DD, included.—
rangebooleanPick a start and an end date: bind= holds {from, to} as YYYY-MM-DD, starting from a record in state like period={from: "", to: ""}. The calendar offers Last 7 days and Last 30 days. filter(orders, 'date', period) keeps the items from the start to the end, both included, and all of them while it's empty.false
placeholderstringShown while no date is chosen.Choose a date
requiredbooleanWhen true, the calendar has no Clear button.false
disabledconditionExpression; when true the field is greyed out and doesn't open.—
onactionActions to run after the date changes, with bind= already set, e.g. emit:changed. Separate several with ;—
ifconditionShow only when this expression is true, e.g. if=done or if={count>0}. Every element takes it.—
tipstringA short explanation shown on hover, keyboard focus or a tap, e.g. tip="Orders not yet shipped": for a term or a number some people won't know, instead of more words on screen. It makes the element a Tab stop if it isn't one. Every element takes it.—

SayShape v0.1 is an early prototype under the MIT License. Status · GitHub