Blazorise DatePicker component

DatePicker is an input field that allows the user to enter a date by typing or by selecting from a calendar overlay.

<DatePicker> is a fully featured date selection component that lets users select a date. Its calendar, keyboard navigation, and parsing are implemented in Blazor and C# without a third-party JavaScript picker. When InputFormat is defined, DatePicker continues to use Blazorise's existing InputMask integration for compatible caret-aware editing. Unlike DateInput, which renders type="date", DatePicker will render type="text" in the DOM.

Examples

Basic example

<Field>
    <DatePicker TValue="DateTime?" @bind-Value="@value" />
</Field>
@code {
    DateTime? value;
}

Add icon

To add icon you can combine DatePicker with an Addon.
<Field>
    <Addons>
        <Addon AddonType="AddonType.Body">
            <DatePicker @ref="@datePicker" TValue="DateTime?" @bind-Value="@value" />
        </Addon>
        <Addon AddonType="AddonType.End">
            <Button Color="Color.Light" Clicked="@(()=>datePicker.ToggleAsync())">
                <Icon Name="IconName.CalendarDay" />
            </Button>
        </Addon>
    </Addons>
</Field>
@code {
    DatePicker<DateTime?> datePicker;

    DateTime? value;
}

Min and max

Use Min and Max to restrict the available dates. Month and year navigation buttons are disabled when their destination month falls entirely outside these limits. Keyboard paging respects the same limits.

The month dropdown disables months outside the allowed range, and the year input uses the minimum and maximum years. Changing the year moves the calendar to the nearest allowed month when needed.

This inline example allows dates from one month before today to one month after today. Navigate to either boundary month to see the corresponding month navigation button become disabled.

<Field>
    <DatePicker TValue="DateTime?"
                @bind-Value="@selectedDate"
                Min="@minDate"
                Max="@maxDate"
                Inline />
</Field>
@code {
    DateTime? selectedDate = DateTime.Today;
    DateTimeOffset minDate = new( DateTime.Today.AddMonths( -1 ) );
    DateTimeOffset maxDate = new( DateTime.Today.AddMonths( 1 ) );
}

Disable dates

If you'd like to make certain dates unavailable for selection you can assign the DisabledDates parameter.
<Field>
    <DatePicker TValue="DateTime?" DisabledDates="@disabledDates" />
</Field>
@code {
    DateTime?[] disabledDates = new DateTime?[] {
        DateTime.Now.AddDays(-1),
        DateTime.Now.AddDays(2),
    };
}

Enable dates

If you'd like to make only certain dates available for selection, you can assign the EnabledDates parameter.
<Field>
    <DatePicker TValue="DateTime?" EnabledDates="@enabledDates" />
</Field>
@code {
    DateTime?[] enabledDates = new DateTime?[]{
        DateTime.Now.AddDays(-1),
        DateTime.Now.AddDays(2),
    };
}

Disable days

If you'd like to make only certain days in a week unavailable for selection you can assign the DisabledDays parameter.
<Field>
    <DatePicker TValue="DateTime?" DisabledDays="@disabledDays" />
</Field>
@code {
    DayOfWeek[] disabledDays = new[]  {
        DayOfWeek.Saturday,
        DayOfWeek.Sunday,
    };
}

Range example

Select a range of dates using the range calendar.
<Field>
    <DatePicker @bind-Value="selectedDates" InputMode="DateInputMode.Date" SelectionMode="DateInputSelectionMode.Range" />
</Field>
@code {
    IReadOnlyList<DateTime?> selectedDates;
}

Multiple example

It is possible to select multiple dates.
<Field>
    <DatePicker @bind-Value="selectedDates" InputMode="DateInputMode.Date" SelectionMode="DateInputSelectionMode.Multiple" />
</Field>
@code{
    IReadOnlyList<DateTime?> selectedDates;
}

Inline Calendar

To always show the calendar you just need to set Inline parameter.
<Field>
    <DatePicker TValue="DateTime?" @bind-Value="@value" Inline />
</Field>
@code {
    DateTime? value;
}

Non-static

By default, the calendar menu will position statically. This means that it will also keep its position relative to the page when you scroll.

If you want to disable this behavior, you should assign the value false to the StaticPicker parameter.

<Field>
    <DatePicker TValue="DateTime?" @bind-Value="@value" StaticPicker="false" />
</Field>
@code {
    DateTime? value;
}

Input mask

In this example, the user is prompted to enter a value in the format dd.MM.yyyy.

Notice that we have also defined a DisplayFormat parameter. This is needed so that after the user finish with the input mask we need to properly parse it using the same format.

<Field>
    <DatePicker TValue="DateTime?" @bind-Value="@value" InputFormat="dd.MM.yyyy" DisplayFormat="dd.MM.yyyy" />
</Field>
@code {
    DateTime? value;
}

Week numbers

Use the ShowWeekNumbers parameter to toggle the visibility of week numbers in the calendar view.

When enabled, a column will appear on the left side of each row in the calendar showing the corresponding week number.

<Field>
    <DatePicker TValue="DateTime?" ShowWeekNumbers="true" />
</Field>

Month selection

Set InputMode to DateInputMode.Month to select a month and year. The selected value is normalized to the first day of the month.

Select the year heading to navigate through years and decades, then select an item to return through the views to the month grid.

<Field>
    <DatePicker TValue="DateTime?"
                @bind-Value="@selectedMonth"
                InputMode="DateInputMode.Month"
                DisplayFormat="MMMM yyyy"
                Placeholder="Select month..."
                ShowTodayButton />
</Field>
@code {
    DateTime? selectedMonth;
}

Week selection

Set InputMode to DateInputMode.Week to select complete Monday-to-Sunday weeks. Week numbers are shown automatically in this mode.

Bound values are normalized to the Monday that starts the selected week. By default, the input displays week values such as 2026-41st.

Week mode supports single, range, and multiple selection. FirstDayOfWeek changes the visual order of the calendar; when Sunday is displayed first, a selected week continues into the following row.

<Field>
    <FieldLabel>Single week</FieldLabel>
    <FieldBody>
        <DatePicker TValue="DateTime?" @bind-Value="@selectedWeek" InputMode="DateInputMode.Week" Placeholder="Select week..." />
    </FieldBody>
</Field>
<Field>
    <FieldLabel>Week range</FieldLabel>
    <FieldBody>
        <DatePicker @bind-Value="@selectedWeekRange" InputMode="DateInputMode.Week" SelectionMode="DateInputSelectionMode.Range" Placeholder="Select week range..." />
    </FieldBody>
</Field>
<Field>
    <FieldLabel>Multiple weeks</FieldLabel>
    <FieldBody>
        <DatePicker @bind-Value="@selectedWeeks" InputMode="DateInputMode.Week" SelectionMode="DateInputSelectionMode.Multiple" Placeholder="Select weeks..." />
    </FieldBody>
</Field>
<Field>
    <FieldLabel>Sunday-first layout</FieldLabel>
    <FieldBody>
        <DatePicker TValue="DateTime?" @bind-Value="@sundayFirstWeek" InputMode="DateInputMode.Week" FirstDayOfWeek="DayOfWeek.Sunday" />
    </FieldBody>
</Field>
@code {
    DateTime? selectedWeek;
    IReadOnlyList<DateTime?> selectedWeekRange;
    IReadOnlyList<DateTime?> selectedWeeks;
    DateTime? sundayFirstWeek = new DateTime( 2026, 7, 15 );
}

Show buttons

Use the ShowTodayButton, or ShowClearButton parameters to toggle the visibility of the buttons in the calendar view.

When enabled, a row of buttons will appear at the bottom of the calendar allowing users to quickly navigate to today or clear the selected date.

<Field>
    <DatePicker TValue="DateTime?" ShowTodayButton ShowClearButton />
</Field>

Default time

By default the time elements are set to 12:00. To change it use the DefaultHour and DefaultMinute parameters.

<Field>
    <DatePicker TValue="DateTime?" InputMode="DateInputMode.DateTime" DefaultHour="9" DefaultMinute="15" />
</Field>

Custom colorsAdded in v2.3

Use Color to set the color variant of the input. Set TextColor independently.
<Fields>
    <Field ColumnSize="ColumnSize.IsFull.OnMobile.Is4.OnTablet">
        <FieldLabel>Indigo</FieldLabel>
        <FieldBody>
            <DatePicker TValue="DateOnly" Value="@(new DateOnly( 2026, 6, 15 ))" Color="@("#312E81")" />
        </FieldBody>
    </Field>
    <Field ColumnSize="ColumnSize.IsFull.OnMobile.Is4.OnTablet">
        <FieldLabel>Teal</FieldLabel>
        <FieldBody>
            <DatePicker TValue="DateOnly" Value="@(new DateOnly( 2026, 6, 15 ))" Color="@(new Color( CssColor.Rgb( 15, 118, 110 ) ))" />
        </FieldBody>
    </Field>
    <Field ColumnSize="ColumnSize.IsFull.OnMobile.Is4.OnTablet">
        <FieldLabel>Explicit text color</FieldLabel>
        <FieldBody>
            <DatePicker TValue="DateOnly" Value="@(new DateOnly( 2026, 6, 15 ))" Color="@CssColor.Variable( "--input-accent", "#7C3AED" )" TextColor="@(new TextColor( "#0F766E" ))" />
        </FieldBody>
    </Field>
</Fields>

Formats

Display Format

Separate display and input formats make dates easy to read and quick to enter. Users can read full month names while entering short numeric dates.

For example, dd.MM.yyyy shows and accepts dates such as 27.07.2026.

Ordinal days

Ordinal day numbers, such as 1st, 2nd, and 3rd, give dates a familiar written form. Appointments and bookings can show the full date, such as Tuesday 3rd November 2026, with day and month names in the user's selected language.

<Field>
    <DatePicker TValue="DateTime?"
                @bind-Value="@value"
                InputFormat="dd.MM.yyyy"
                DisplayFormat="dddd {day:ordinal} MMMM yyyy"
                DisableMobile />
</Field>
@code {
    DateTime? value = new DateTime( 2026, 11, 3 );
}

Day numbers and languages

In DisplayFormat, {day:ordinal} shows the day number in the selected language, such as 3rd in English or 3. in Croatian. It works with date formats such as dddd for the weekday and MMMM for the month name. Ordinal formatting is currently available for the day number only.

Weekday names, month names, and day numbers update when the selected Blazorise language changes. Each language has its own way of writing dates. Some add letters to the day number, some add a period, and others use just the number.

Language Day examples
English 1st, 2nd, 3rd, 11th
French 1er, 2, 3
Spanish 1.º, 2, 3
Italian and Portuguese 1º, 2, 3
Croatian, Czech, Danish, German, Icelandic, and Slovak 1., 2., 3.
Chinese, Dutch, Polish, Romanian, Russian, and Turkish 1, 2, 3

These day forms are included for all supported DatePicker languages. If an ordinal translation is missing, DatePicker shows just the day number. For languages such as Croatian and German, {day:ordinal} already includes the period after the number.

InputFormat supports numeric date entry, such as dd.MM.yyyy, while {day:ordinal} is supported only in DisplayFormat. Without an InputFormat, users can also type the date as displayed, including its translated names and day number.

Mobile browsers normally use their own date display. The example uses DisableMobile so dates keep the same display format on desktop and mobile.

Best Practices

Date Format

Use a placeholder or helper to show how the input should be formatted. For example, "12/6/2020" represents different dates for Americans and Europeans.

Helpers are preferable to placeholders, as they are always visible. Fields with placeholders are also less noticeable than empty fields, so they are susceptible to being skipped. Use placeholders when space is limited, for example when Date Picker is used as a filter in a data grid header.

Format: DD/MM/YYYY
<Field>
    <FieldLabel>Start date</FieldLabel>
    <FieldBody>
        <DatePicker TValue="DateTime?" Placeholder="DD/MM/YYYY" />
    </FieldBody>
    <FieldHelp>Format: DD/MM/YYYY</FieldHelp>
</Field>

API

See the API reference for the parameters, events, methods, and related types available to the components covered on this page.