Forms
TwDateRangePicker
TwDateRangePicker is a Blazor date range picker with a two-month calendar popup. Bind Value or SelectedRange and constrain it with MinDate and MaxDate.
Last updated
Basic Date Range Picker
Bind
SelectedRange for a KeyValuePair<DateTime?, DateTime?> value (Key = start, Value = end). Select a start date, then an end date - the range highlights across both calendar months and survives month navigation. Shares its theme (TwDatePickerTheme) with TwDatePicker.@bind-SelectedRange: - - -
Custom Format
Format is a plain .NET custom date format string applied identically to both the start and end date - the same parameter TwDatePicker uses. The separator between the two dates defaults to " - " and is configurable via RangeSeparator.Min and Max Date
Use the
MinDate and MaxDate properties to restrict the selectable range. Out-of-bounds days render disabled and the month navigation arrows stop at the boundary.Input Variants
The date range picker supports the same visual variants as the other text inputs.
Dense Date Range Picker
Set
Dense for a more compact input with a smaller height and text size. Every single-line input shares the same dense height, so they line up when used side by side.Disabled and Readonly Date Range Picker
Use the
Disabled and ReadOnly properties to restrict interaction with the date range picker.Theme Configuration
Styling is controlled by
TwBlazorTheme.Components (a TwDatePickerTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
| Property | Type | Controls |
|---|---|---|
Header |
string | |
WeekdaysHeader |
string | |
Base |
string | |
ActiveClass |
string | |
ButtonClass |
string | |
RangeClass |
string | |
RangeMonthCaptionClass |
string | |
PrevMonthClass |
string | |
DefaultFormat |
string | |
DefaultDateTimeFormat |
string | |
DefaultDateTimeFormat12Hour |
string | |
DefaultRangeSeparator |
string | |
IconTriggerWrapper |
string | |
IconGlyph |
string | |
TextfieldPadding |
string | |
NativeInputAppearance |
string | |
PanelWidth |
string | |
HeaderControls |
string | |
Body |
string | |
YearsGrid |
string | |
MonthsGrid |
string | |
DualMonthLayout |
string | |
DualMonthColumn |
string | |
DayGrid |
string | |
DayHeaderCellPadding |
string | |
DayAbbreviation |
string | |
RangeStageTabsContainer |
string | |
RangeStageTabInactive |
string | |
PanelMaxHeight |
string | |
PanelMaxWidth |
string | |
DualMonthPanelWidth |
string | |
StageTabBase |
string | |
HeaderNavButton |
string |
Full reference: TwDatePickerTheme on the API docs.