Blazorise Date Picker API
Explore the Blazorise Date Picker API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Date Picker documentation.
API
Parameters
| Parameter | Description | Type | Default |
|---|---|---|---|
AriaDescribedBy |
Specifies the aria-describedby attribute value. RemarksWhen set, this value is rendered as-is and overrides help and validation message ids generated by Field and Validation. |
string | |
AriaInvalid |
Specifies the aria-invalid attribute value. RemarksWhen set, this value is rendered as-is and overrides the validation-derived aria-invalid state. |
string | |
AriaLabelledBy |
Specifies the aria-labelledby attribute value. RemarksWhen set, this value is rendered as-is. Some non-labelable controls can otherwise derive it automatically from a parent FieldLabel or FieldsLabel. |
string | |
AriaRequired |
Specifies the aria-required attribute value. RemarksWhen set, this value overrides the required-field state resolved from the parent Validation. |
bool | false |
Autofocus |
Set's the focus to the component after the rendering is done. |
bool | false |
ChildContent |
Specifies the content to be rendered inside this DatePicker. |
RenderFragment | null |
Color |
Sets the input text color. |
Color | Color.Default |
DefaultHour |
Specifies the initial value of the hour element. |
int | 12 |
DefaultMinute |
Specifies the initial value of the minute element. |
int | 0 |
Disabled |
Add the disabled boolean attribute on an input to prevent user interactions and make it appear lighter. |
bool | false |
DisabledDates |
List of disabled dates that the user should not be able to pick. |
IEnumerable | null |
DisabledDays |
List of disabled days in a week that the user should not be able to pick. |
IEnumerable<DayOfWeek> | null |
DisableMobile |
Prevents the browser's native picker from being used on mobile devices. |
bool | true |
DisplayFormat |
Specifies the display format of the date input using the picker format syntax supported by earlier versions. RemarksWeek mode additionally supports |
string | |
EnabledDates |
List of enabled dates that the user should be able to pick. |
IEnumerable | null |
Feedback |
Placeholder for validation messages. |
RenderFragment | null |
FirstDayOfWeek |
Specifies the first day of the week used for date calculations. RemarksIn week mode this controls the visual calendar layout. Selected values continue to represent ISO Monday-to-Sunday weeks. |
DayOfWeek | DayOfWeek.Monday |
Inline |
Display the calendar in an always-open state with the inline option. |
bool | false |
InputFormat |
Specifies the input format mask of the date input using Blazorise's InputMask integration. RemarksWeek mode supports the |
string | |
InputMode |
Hints at the type of data that might be entered by the user while editing the element or its contents. Possible values: |
DateInputMode | DateInputMode.Date |
Intent |
Sets the input text intent. |
Intent | null |
Max |
The latest date to accept. Updating this value does not change the selected date, even if it exceeds the new maximum. |
DateTimeOffset? | null |
Min |
The earliest date to accept. Updating this value does not change the selected date, even if it falls below the new minimum. |
DateTimeOffset? | null |
OnScreenKeyboard |
Enables the on-screen keyboard for this input component. When not explicitly set, the global accessibility option is used. |
bool | false |
OnScreenKeyboardEnterKeyBehavior |
Specifies how the on-screen keyboard enter key should behave for this input component. Possible values: |
OnScreenKeyboardEnterKeyBehavior | OnScreenKeyboardEnterKeyBehavior.Default |
OnScreenKeyboardLayout |
Specifies the on-screen keyboard layout for this input component. When not explicitly set, the global accessibility option is used. Possible values: |
OnScreenKeyboardLayout | OnScreenKeyboardLayout.Text |
OnScreenKeyboardShowMode |
Gets or sets how the on-screen keyboard is shown for this input. Possible values: |
OnScreenKeyboardShowMode | OnScreenKeyboardShowMode.Default |
OpenTrigger |
Defines which interactions can open the calendar menu. Possible values: |
PickerOpenTrigger | default(PickerOpenTrigger) |
Pattern |
The pattern attribute specifies a regular expression that the input element's value is checked against on form validation. |
string | |
Placeholder |
Sets the placeholder for the empty text. |
string | |
Plaintext |
Sets the class to remove the default form field styling and preserve the correct margin and padding. |
bool | false |
RangeSeparator |
Overrides the range separator that is used to separate date values when SelectionMode is set to Range. |
string | |
ReadOnly |
Add the readonly boolean attribute on an input to prevent modification of the input’s value. |
bool | false |
SelectionMode |
Specifies the mode in which the dates can be selected. Possible values: |
DateInputSelectionMode | DateInputSelectionMode.Single |
ShowClearButton |
Determines whether to show the clear button in the calendar menu. |
bool | false |
ShowTodayButton |
Determines whether to show the today button in the calendar menu. |
bool | false |
ShowWeekNumbers |
Determines whether the calendar menu will show week numbers. RemarksWeek numbers are always shown when InputMode is Week. |
bool | false |
Size |
Sets the size of the input control. |
Size? | null |
StaticPicker |
If enabled, the calendar menu will be positioned as static. |
bool | true |
TabIndex |
If defined, indicates that its element can be focused and can participates in sequential keyboard navigation. |
int? | null |
TimeAs24hr |
Displays time picker in 24 hour mode without AM/PM selection when enabled. |
bool | false |
Value |
Specifies the value inside the input field. |
TValue | null |
ValueExpression |
Specifies an expression that identifies the input value. |
Expression<Func<TValue>> | null |
Events
| Event | Description | Type |
|---|---|---|
Blur |
The blur event fires when an element has lost focus. |
EventCallback<FocusEventArgs> |
CustomValidationValue |
Used to provide custom validation value on which the validation will be processed with the Validator handler. RemarksShould be used carefully as it's only meant for some special cases when input is used in a wrapper component, like Autocomplete or SelectList. |
Func<TValue> |
FocusIn |
Notifies when the input box gains focus. |
EventCallback<FocusEventArgs> |
FocusOut |
Notifies when the input box loses focus. |
EventCallback<FocusEventArgs> |
KeyDown |
Notifies when a key is pressed down while the control has focus. |
EventCallback<KeyboardEventArgs> |
KeyPress |
Notifies when a key is pressed while the control has focus. |
EventCallback<KeyboardEventArgs> |
KeyUp |
Notifies when a key is released while the control has focus. |
EventCallback<KeyboardEventArgs> |
OnFocus |
Notifies when the input box gains or loses focus. |
EventCallback<FocusEventArgs> |
ValueChanged |
Occurs after value has changed. |
EventCallback<TValue> |
Methods
| Method | Description | Return | Parameters |
|---|---|---|---|
CloseAsync |
Closes the calendar dropdown. | ValueTask | |
OpenAsync |
Opens the calendar dropdown. | ValueTask | |
ToggleAsync |
Shows/opens the calendar if its closed, hides/closes it otherwise. | ValueTask | |
Select |
Select all text in the underline component. | Task | bool focus |
ShowOnScreenKeyboard |
Shows the on-screen keyboard for this input. | Task | bool focus |
Focus |
Sets the focus on the underline element. | Task | bool scrollToElement |
Revalidate |
Forces the Validation (if any is used) to re-validate with the new custom or internal value. | Task |