Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • DrawerNew
  • Footer
  • MenuNew
  • Navbar
  • On This PageNew
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Button
  • FormNew
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • NumericNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Textfield
    • Time Picker
    • Time Range Picker
  • Alert
  • Avatar
  • Chip
  • Icon
  • PopoverNew
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • Pagination
  • Pick List
  • BarcodeNew
  • QR CodeNew
  • CalendarNew
  • Table
  • AttachmentNew
  • 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

TwRangeSlider

TwRangeSlider is a Blazor range slider with two handles for choosing a minimum and maximum value. Bind LowerValue and UpperValue and set Min, Max and Step.

Last updated 23 October 2026

Please be aware this component is new, may have bugs and/or be subject to change. Please report any bugs at https://github.com/twblazor/twblazor/issues.

Basic usage

Bind LowerValue and UpperValue to pick a range between Min and Max. The handles cannot pass each other.
200
750

From $200 to $750

RAZOR
<TwRangeSlider T="int" Id="price-range-slider" Min="0" Max="1000" Step="10" Label="Price" @bind-LowerValue="lowPrice" @bind-UpperValue="highPrice" />
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">From <strong>@($"${lowPrice}")</strong> to <strong>@($"${highPrice}")</strong></p>
CSHARP
@code {
    private int lowPrice = 200;
    private int highPrice = 750;
}

Colors

Use Color to tint the filled range between the handles.
19
23

19°C to 23°C

20
80

Alert between 20% and 80%

RAZOR
<div class="space-y-6">
    <div>
        <TwRangeSlider T="int" Id="comfort-range-slider" Min="10" Max="30" Step="1" Label="Comfortable temperature" Color="Color.Success" @bind-LowerValue="comfortLow" @bind-UpperValue="comfortHigh" />
        <p class="mt-2 text-sm text-gray-600 dark:text-gray-400">@comfortLow&deg;C to @comfortHigh&deg;C</p>
    </div>

    <div>
        <TwRangeSlider T="int" Id="alert-range-slider" Min="0" Max="100" Step="1" Label="Alert band" Color="Color.Danger" @bind-LowerValue="alertLow" @bind-UpperValue="alertHigh" />
        <p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Alert between @alertLow% and @alertHigh%</p>
    </div>
</div>
CSHARP
@code {
    private int comfortLow = 19;
    private int comfortHigh = 23;
    private int alertLow = 20;
    private int alertHigh = 80;
}

Minimum distance

Set MinDistance to keep a gap between the handles. Here a booking must be at least two hours long.
10
14

10:00 to 14:00 (4 hours)

RAZOR
<TwRangeSlider T="int" Id="booking-range-slider" Min="8" Max="20" Step="1" MinDistance="2" Label="Booking hours" Color="Color.Accent" @bind-LowerValue="bookingStart" @bind-UpperValue="bookingEnd" />
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">@bookingStart:00 to @bookingEnd:00 (@(bookingEnd - bookingStart) hours)</p>
CSHARP
@code {
    private int bookingStart = 10;
    private int bookingEnd = 14;
}

Precision

Any numeric type works through T. Use decimal or double with a fractional Step for fine control.
3.5
5

Rated 3.5 to 5.0

RAZOR
<TwRangeSlider T="decimal" Id="rating-range-slider" Min="0m" Max="5m" Step="0.5m" Label="Rating" @bind-LowerValue="ratingLow" @bind-UpperValue="ratingHigh" />
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Rated <strong>@ratingLow.ToString("0.0")</strong> to <strong>@ratingHigh.ToString("0.0")</strong></p>
CSHARP
@code {
    private decimal ratingLow = 3.5m;
    private decimal ratingHigh = 5m;
}

Disabled & readonly

Disabled dims and locks both handles; ReadOnly keeps the color but blocks changes.
25
60
30
70
RAZOR
<div class="space-y-6">
    <TwRangeSlider T="int" Id="disabled-range-slider" Min="0" Max="100" Step="1" Label="Disabled" @bind-LowerValue="disabledLow" @bind-UpperValue="disabledHigh" Disabled />
    <TwRangeSlider T="int" Id="readonly-range-slider" Min="0" Max="100" Step="1" Label="Readonly" Color="Color.Danger" @bind-LowerValue="readonlyLow" @bind-UpperValue="readonlyHigh" ReadOnly />
</div>
CSHARP
@code {
    private int disabledLow = 25;
    private int disabledHigh = 60;
    private int readonlyLow = 30;
    private int readonlyHigh = 70;
}

Keyboard navigation

Each handle is a native range input named Minimum or Maximum, inside a group named by the label. A handle stops when it reaches the other one. A read-only range slider can be focused but its values cannot be changed.
Key What it does
Tab or Shift+ plus Tab Moves focus to the minimum handle, then to the maximum handle.
Arrow Right or Arrow Up Increases the focused handle's value by one step.
Arrow Left or Arrow Down Decreases the focused handle's value by one step.
Home or End Moves the focused handle as far as it can go.
Pg.Up or Pg.Down Changes the focused handle's value by a larger amount.

Theme configuration

Styling is controlled by TwBlazorTheme.Components (a TwRangeSliderTheme), 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
Handle string
Base string
Fill string

Full reference: TwRangeSliderTheme on the API docs.

On this page

  • Basic usage
  • Colors
  • Minimum distance
  • Precision
  • Disabled & readonly
  • Keyboard navigation
  • Theme configuration
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