Range

DRange is a native input[type="range"] with daisyUI's range classes and @bind-Value of a double.

Interactive— Volume drives the badge — works in WASM and interactive Server

60

Current gain: 60%

<DRange Label="Volume" Min="0" Max="100" Step="1" Color="DaisyColor.Primary" @bind-Value="_volume" />
<p class="mt-3">
    <span class="badge badge-primary badge-lg w-16 justify-center">@_volume</span>
</p>
<p class="mt-4 opacity-70 text-sm">
    Current gain: <strong>@(_volume)%</strong>
</p>
 
@code {
    private double _volume = 60;
}
Sizes— range-xs to range-lg
<DRange Size="DaisySize.ExtraSmall" @bind-Value="_s1" />
<DRange Size="DaisySize.Small" @bind-Value="_s2" />
<DRange Size="DaisySize.Medium" @bind-Value="_s3" />
<DRange Size="DaisySize.Large" @bind-Value="_s4" />
 
@code {
    private double _s1 = 20;
    private double _s2 = 40;
    private double _s3 = 60;
    private double _s4 = 80;
}
Colors, steps and disabled
<DRange Color="DaisyColor.Secondary" @bind-Value="_c1" />
<DRange Color="DaisyColor.Accent" @bind-Value="_c2" />
<DRange Color="DaisyColor.Warning" @bind-Value="_c3" />
<DRange Label="Fine control" Min="-5" Max="5" Step="0.5" Color="DaisyColor.Info" @bind-Value="_fine" />
<DRange Label="Disabled" Disabled="true" @bind-Value="_disabled" />
 
@code {
    private double _c1 = 30;
    private double _c2 = 55;
    private double _c3 = 75;
    private double _fine = 1.5;
    private double _disabled = 45;
}

API

DRange

Parameters

Name Type Default Binding Description
Min double? 0 — Minimum value (native min attribute).
Max double? 100 — Maximum value (native max attribute).
Step double? 1 — Step granularity (native step attribute).
Label string — — Optional label rendered above the slider.
Color DaisyColor Default — daisyUI color (range-primary, range-accent, ...).
DefaultPrimarySecondaryAccentInfoSuccessWarningErrorGhostNeutral
Size DaisySize Medium — Sizes the track/thumb (range-xs ... range-lg).
ExtraSmallSmallMediumLargeExtraLarge
Disabled bool False — Disables the slider.
Class string — — —
Style string — — —
Value double 0 @bind-Value —
ValueExpression Expression<Func<double>> — — —
DisplayName string — — —
Connection lost — reconnecting…
Connection failed.
The server has stopped.