Forms
TwTimeRangePicker
TwTimeRangePicker is a Blazor component for choosing a start and end time from one popover. Bind Value or SelectedRange and set Format and Placeholder.
Last updated
Basic time range picker
Bind
SelectedRange for a KeyValuePair<TimeOnly?, TimeOnly?> value (Key = start, Value = end). The popover reuses the same hour/minute editor as TwTimePicker, switching between the start and end with the Start/End tab at the top. Unlike the date-based range pickers, an end time earlier than the start is left as-is rather than swapped - it just represents a range that crosses midnight (e.g. an overnight shift).@bind-SelectedRange: - - -
12-hour format
Set
Is12HourFormat to display and edit the time with an AM/PM toggle instead of 24-hour time.Step
Set
Step to the number of minutes the start and end time arrow buttons and the Arrow Up/Arrow Down keys move by. Under an hour, the minutes step (15 gives :00, :15, :30 and :45). From 60 upwards, the hours step instead (120 moves two hours at a time) and the minutes are shown as fixed text with no arrow buttons. The step must divide an hour (1, 2, 3, 4, 5, 6, 10, 12, 15, 20 or 30) or be a whole number of hours that divides a day (60, 120, 180, 240, 360, 480 or 720). A time typed into the field is kept as entered. When the browser's native picker is used, the step is passed on to it.Input variants
The time range picker supports the same visual variants as the other text inputs.
Dense time 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 time range picker
Use the
Disabled and ReadOnly properties to restrict interaction with the time range picker.