Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

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 16 October 2026

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: - - -

RAZOR
<div class="space-y-4">
    <p><b>@@bind-SelectedRange:</b> @(SelectedRange.Key?.ToString("t") ?? "-") - @(SelectedRange.Value?.ToString("t") ?? "-")</p>
    <TwTimeRangePicker Id="basic-timerangepicker" @bind-SelectedRange="SelectedRange" Label="Select a shift" Class="mt-3" />
</div>
CSHARP
@code {
    public KeyValuePair<TimeOnly?, TimeOnly?> SelectedRange { get; set; }
}

12-hour format

Set Is12HourFormat to display and edit the time with an AM/PM toggle instead of 24-hour time.
RAZOR
<TwTimeRangePicker Id="12hr-timerangepicker" @bind-SelectedRange="SelectedRange" Is12HourFormat Label="Select a shift" Class="mt-3" />
CSHARP
@code {
    public KeyValuePair<TimeOnly?, TimeOnly?> SelectedRange { get; set; }
}

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.
RAZOR
<TwTimeRangePicker Id="step-timerangepicker" @bind-SelectedRange="SelectedRange" Step="15" Label="Select a shift" Class="mt-3" />
CSHARP
@code {
    public KeyValuePair<TimeOnly?, TimeOnly?> SelectedRange { get; set; }
}

Input variants

The time range picker supports the same visual variants as the other text inputs.
RAZOR
<div class="space-y-4">
    <TwTimeRangePicker Id="default-variant" @bind-SelectedRange="SelectedRange" Label="Default Variant" Variant="InputVariant.Default" />
    <TwTimeRangePicker Id="outlined-variant" @bind-SelectedRange="SelectedRange" Label="Outlined Variant" Variant="InputVariant.Outlined" />
    <TwTimeRangePicker Id="filled-variant" @bind-SelectedRange="SelectedRange" Label="Filled Variant" Variant="InputVariant.Filled" />
</div>
CSHARP
@code {
    public KeyValuePair<TimeOnly?, TimeOnly?> SelectedRange { get; set; }
}

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.
RAZOR
<TwTimeRangePicker Id="dense-timerangepicker" @bind-SelectedRange="SelectedRange" Label="Dense Time Range Picker" Dense />
CSHARP
@code {
    public KeyValuePair<TimeOnly?, TimeOnly?> SelectedRange { get; set; }
}

Disabled and readonly time range picker

Use the Disabled and ReadOnly properties to restrict interaction with the time range picker.
RAZOR
<div class="space-y-4">
    <TwTimeRangePicker Id="disabled-timerangepicker" @bind-SelectedRange="SelectedRange" Label="Disabled Time Range Picker" Disabled />
    <TwTimeRangePicker Id="readonly-timerangepicker" @bind-SelectedRange="SelectedRange" Label="Readonly Time Range Picker" ReadOnly />
</div>
CSHARP
@code {
    public KeyValuePair<TimeOnly?, TimeOnly?> SelectedRange { get; set; }
}

Keyboard navigation

The panel sets one end of the range at a time. The Start and End buttons at the top switch between them.
Key What it does
Tab Moves focus to the field. The panel stays closed, so you can tab straight past it.
Arrow Down Opens the panel and moves focus into it.
Enter or Space On the icon button beside the field: opens the panel and moves focus into it, or closes it.
Enter Commits a value typed into the field.
Escape Closes the panel and returns focus to the field. Works from the field and from inside the panel.
Tab or Shift+ plus Tab Moves between the controls in the open panel. Focus stays in the panel until it is closed.
Enter or Space On the Start or End button: switches to that end of the range.
Arrow Up or Arrow Down In the hour or minute field: increases or decreases the value by one, or moves to the next or previous step when Step is set. When Step is a whole number of hours, the minutes are fixed text and are skipped by Tab.
Enter or Space On an arrow button or the AM/PM button: presses it.

On this page

  • Basic time range picker
  • 12-hour format
  • Step
  • Input variants
  • Dense time range picker
  • Disabled and readonly time range picker
  • Keyboard navigation
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload