Types
The datebox component is almost identical to the textbox but includes additional features specific to date input.
It supports various date types, including
DateTime, DateTimeOffset, DateOnly,
TimeOnly. Additionally, their nullable counterparts are also supported.
Usage
Disabled
Read-Only
Required
Sizes
Radius
Colors
Variants
Label Placements
Label parameter is not set, the LabelPlacement
parameter will default to Outside.
Clear Button
Start & End Content
Description
Error Message
Display an error message below the datebox to indicate validation issues.
You can combine the Invalid and ErrorMessage parameters to show an invalid input.
An error message is shown only when the Invalid parameter is set to true.
Two-way Data Binding
Use @bind-Value directive or Value and ValueChanged
parameters to manually control datebox value.
Custom styles
This component supports named slots, which allow custom styles to be applied to specific parts of the component:
- Base: The overall wrapper.
- Label: The label element.
- MainWrapper: The wrapper of the input wrapper (when the label is outside).
- InputWrapper: The wrapper of the label and the inner wrapper (when the label is inside).
- InnerWrapper: The wrapper of the input, start/end content.
- Input: The input element.
- ClearButton: The clear button element.
- HelperWrapper: The wrapper of a description and an error message.
- Description: The description of the input field.
- ErrorMessage: The error message of the input field.
You can customize the component(s) by passing any Tailwind CSS classes to the following component parameters:
Datebox
Class: The CSS class names to style the datebox wrapper.Classes: The CSS class names to style the datebox slots.
API
See the API references below for a complete guide to all the parameters available for the components mentioned here.