Appearance
In this article, you will find information about the styling options and rendering of the Telerik UI for ASP.NET Core DatePicker.
For a live example, visit the Appearance Demo or the DatePicker.
Options
The DatePicker supports the following styling options:
-
Size
—configures the overall size of the component. -
Rounded
—configures the border radius of the component. -
FillMode
—configures how the color is applied to the component.
Size
The Size
option controls the size of the DatePicker. The k-input-{size}
class, which is applied to the wrapping span element of the DatePicker, reflects the value of the Size
option.
The following values are available for the Size
option:
-
Small
—small size (applies thek-input-sm
class to the wrapping span element). -
Medium
—medium size (applies thek-input-md
class to the wrapping span element). -
Large
—large size (applies thek-input-lg
class to the wrapping span element). -
None
—unset.
The following example demonstrates how to set Size
in the declaration of the DatePicker:
@(Html.Kendo().DatePicker()
.Name("datepicker")
.Size(ComponentSize.Medium)
.Value(new DateTime(2011, 10, 10))
.HtmlAttributes(new { style = "width: 100%", title = "datepicker" })
)
<kendo-datepicker name="datepicker"
size="ComponentSize.Medium"
value="new DateTime(2011, 10, 10)"/>
The default Size
value is Medium
and it is applied to the wrapping span element through the k-input-md
class.
<span class="k-datepicker k-input k-input-md">
</span>
Rounded
The Rounded
option controls the border radius of the DatePicker. The class that corresponds to the Rounded
option is k-rounded-{rounded}
.
The following values are available for the Rounded
option:
-
Small
—small border radius (applies thek-rounded-sm
class to the wrapping span element). -
Medium
—medium border radius (applies thek-rounded-md
class to the wrapping span element). -
Large
—large border radius (applies thek-rounded-lg
class to the wrapping span element). -
Full
—largest border radius (applies thek-rounded-full
class to the wrapping span element). -
None
—unset.
The following example demonstrates how to set Rounded
in the declaration of the DatePicker:
@(Html.Kendo().DatePicker()
.Name("datepicker")
.Rounded(Rounded.Medium)
.Value("10/10/2011")
.HtmlAttributes(new { style = "width: 100%", title = "datepicker" })
)
<kendo-datepicker name="datepicker"
rounded="Rounded.Medium"
value="new DateTime(2011, 10, 10)"/>
The default Rounded
value is Medium
and it is applied to the wrapping span element through the k-rounded-md
class.
<span class="k-datepicker k-input k-rounded-md">
</span>
FillMode
The FillMode
option controls the way color is applied to the rendered DatePicker. The k-input-{fillMode}
class, which is applied to the wrapping span element of the DatePicker, reflects the value of the FillMode
option.
The following values are available for the FillMode
option:
-
Solid
—applies thek-input-solid
class to the wrapping span element. -
Flat
—applies thek-input-flat
class to the wrapping span element. -
Outline
—applies thek-input-outline
class to the wrapping span element. -
None
—unset.
The following example demonstrates how to set FillMode
in the declaration of the DatePicker:
@(Html.Kendo().DatePicker()
.Name("datepicker")
.FillMode(FillMode.Solid)
.Value("10/10/2011")
.HtmlAttributes(new { style = "width: 100%", title = "datepicker" })
)
<kendo-datepicker name="datepicker"
fill-mode="FillMode.Solid"
value="new DateTime(2011, 10, 10)"/>
The default FillMode
value is Solid
and it is applied to the wrapping span element through the k-input-solid
class.
<span class="k-datepicker k-input k-input-solid">
</span>
Rendering
Starting with version R1 2022, the component has a new rendering. For additional information on the decision behind these changes, visit the Components Rendering Overview article.
To review the latest rendering of the component, refer to the HTML specifications in the Kendo UI Themes Monorepo. The tests
folder of the repository contains the rendering for all flavors of the components, providing a clear reference for how their elements are structured. The rendering information can help you customize a component's appearance and behavior by applying custom CSS or JavaScript to suit specific design or functional requirements.