Pickers
DateRangePicker
Bit.BlazorUIDateTimeRangePicker
A BitDateRangePicker is a drop-down calendar for picking a start and an end date, where context such as the day of the week matters. It offers one-click presets, up to three months side by side, range limits and disabled days, an optional time picker, an optional Apply/Cancel step, an inline mode, full keyboard support and any culture or time zone.
Validation & accessibility
Form validation and app-side error messages, keyboard and screen-reader support, and opening or closing the callout from code.
Validation
Inside an EditForm the picker takes part in data-annotations validation like any input; a custom
attribute holds the range rules the calendar cannot express. Typed text is also checked against the
calendar's own restrictions, each failure with its own message: InvalidErrorMessage (unreadable),
DisabledDateErrorMessage (a blocked day) and OutOfRangeErrorMessage (bounds or min/max length).
ShowValidationMessage shows those messages under the field, where ErrorMessage goes, so the forms below need no
A half-picked range is a valid value, so a
For a rejection decided outside the form - a server, a rule spanning two fields - ErrorMessage shows a message under the field and marks it invalid, Invalid marks it invalid without a message, and ErrorMessageTemplate shows markup instead of text, with ErrorMessageAriaLabel as what a screen reader hears for it. The pickers further down show all three.
ShowValidationMessage shows those messages under the field, where ErrorMessage goes, so the forms below need no
ValidationMessage component. The input is described by them through
aria-describedby, so they are read out when it takes the focus, and an ErrorMessage of
the app's own wins the place while it is set. They are not announced as they appear: a submit validates
every field at once, and a message from each of them read out in a row would bury the form under its own
errors. A BitParams holding a BitDateRangePickerParams with ShowValidationMessage
turns it on for every picker inside it.
A half-picked range is a valid value, so a
[Required] attribute alone accepts a range with no end
date; the form below adds a custom attribute that demands both. Without the custom messages, typed text is
refused with "The name field is not valid.", "... contains a date that is not available." or "... is
out of the allowed range.", where the name is DisplayName, or the bound property's name when it is
not set. NoValidate takes the picker out of the form's validation: it reports neither its changes nor
a refused text to the EditContext, and shows none of its messages.
For a rejection decided outside the form - a server, a rule spanning two fields - ErrorMessage shows a message under the field and marks it invalid, Invalid marks it invalid without a message, and ErrorMessageTemplate shows markup instead of text, with ErrorMessageAriaLabel as what a screen reader hears for it. The pickers further down show all three.
Type a weekend into the field below to see the blocked-day message, and a range longer than 7 days to see the
out-of-range one. Those messages are kept by the EditContext, so the field sits in an EditForm of its
own:
Not every rejection comes from an EditForm. Invalid forces the error look and
aria-invalid on a range something else refused - a server, a rule spanning two fields - and
ErrorMessage adds the line that says why, right under the field (under the calendar of a
Standalone picker). A message implies Invalid, so the flag on its own is for marking a picker
whose explanation lives somewhere else. The input is described by the line, and a live region says it the
moment it appears. ErrorMessageTemplate puts arbitrary markup there instead. A template has no text a
screen reader can be handed, so it is announced as a bare "Invalid input" unless
ErrorMessageAriaLabel says what it shows.
The first picker starts on a one-night stay, which the app refuses; pick a longer one to clear the message:
A stay must be at least two nights.
A stay must be at least two nights.
Selected date range Start: 12/5/2026 - End: 12/6/2026
December 2026
S
M
T
W
T
F
S
November 2026
S
M
T
W
T
F
S
Those days are fully booked.
Join the waiting list(opens in a new tab)
Those days are fully booked.Those days are fully booked.
November 2026
S
M
T
W
T
F
S
Accessibility
The field is a
Field: ArrowDown opens, and so do Enter and Space unless AllowTextInput makes the field editable (the focus then stays in the field). Escape closes from anywhere in the callout and returns the focus to the field; moving the focus out of both the field and the callout closes it too. Day grid: arrows move by a day or a week, Home/End to the week's ends, PageUp/PageDown by a month (Shift: a year), Enter/Space picks, Escape closes; disabled days are skipped and the arrows preview the range as the pointer does. Month and year grids take the same keys. Time picker: PageUp/PageDown step by HourStep/MinuteStep.
Every text read by a screen reader is a parameter (AriaLabel, CalloutAriaLabel, PresetsAriaLabel, the …Title and …AriaLabel texts, and SelectedDateAriaAtomic for the live announcement), so it localizes without resources. High Contrast mode and
A picker with no visible Label needs an AriaLabel, as this one has: a Placeholder is not a name. Each day is announced by its full date in the Culture's long date pattern, today as the current date, and SelectedDateAriaAtomic (
combobox opening a modal dialog; focus moves in on open, is trapped
while open and returns to the field on close. Each calendar is a grid with a single tab stop.
Field: ArrowDown opens, and so do Enter and Space unless AllowTextInput makes the field editable (the focus then stays in the field). Escape closes from anywhere in the callout and returns the focus to the field; moving the focus out of both the field and the callout closes it too. Day grid: arrows move by a day or a week, Home/End to the week's ends, PageUp/PageDown by a month (Shift: a year), Enter/Space picks, Escape closes; disabled days are skipped and the arrows preview the range as the pointer does. Month and year grids take the same keys. Time picker: PageUp/PageDown step by HourStep/MinuteStep.
Every text read by a screen reader is a parameter (AriaLabel, CalloutAriaLabel, PresetsAriaLabel, the …Title and …AriaLabel texts, and SelectedDateAriaAtomic for the live announcement), so it localizes without resources. High Contrast mode and
prefers-reduced-motion are honored.
A picker with no visible Label needs an AriaLabel, as this one has: a Placeholder is not a name. Each day is announced by its full date in the Culture's long date pattern, today as the current date, and SelectedDateAriaAtomic (
{0} is the field's text) is read out whenever
the range changes. The titles with placeholders keep them: GoToPrevYearTitle/GoToNextYearTitle
take the year as {0}, the year-range titles the first and last year as {0} and
{1}, and WeekNumberTitle the week number.
:
:
Open state
@bind-IsOpen opens and closes the callout from anywhere on the page; a component reference offers
OpenCallout and CloseCallout. Bound one way, IsOpen stops the picker closing itself - the
page decides. OnOpen and OnClose report every change, whatever caused it.
Opening from code does what a click on the field does: the calendar moves to the value's month, the focus moves into the callout (or into the field, with AllowTextInput), and an AutoApply="false" picker starts its transaction. Closing from code rolls that transaction back like any close that is not Apply. With a one-way IsOpen, neither a completed range, nor a preset, nor Apply, Cancel or Escape closes the callout - the selection still goes through, and the page closes it by setting IsOpen to
Opening from code does what a click on the field does: the calendar moves to the value's month, the focus moves into the callout (or into the field, with AllowTextInput), and an AutoApply="false" picker starts its transaction. Closing from code rolls that transaction back like any close that is not Apply. With a one-way IsOpen, neither a completed range, nor a preset, nor Apply, Cancel or Escape closes the callout - the selection still goes through, and the page closes it by setting IsOpen to
false. IsOpen starting as true opens the callout on the
first render. All of this does nothing on a Standalone or Disabled picker.
November 2026
S
M
T
W
T
F
S
The callout is closed
November 2026
S
M
T
W
T
F
S
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.