Tesserae

DatePicker

Description

The DatePicker is a UI component that allows users to select a date using the native browser date picker widget. As part of the Components group, it is built on top of a moment picker base, providing built-in functionality for formatting dates, handling validations, and configuring browser fallbacks. Use this component when you require users to input dates in your application.

Usage

Instantiate the DatePicker using the static helper method from Tesserae.UI. You can optionally supply a default date value and further configure the component by setting properties such as minimum and maximum selectable dates, step increments, required status, and validations. The provided sample demonstrates how to create several instances of the DatePicker with different settings.

API reference

class

DatePicker

public class DatePicker : MomentPickerBase<DatePicker, DateTime>

A form input for picking a single calendar date, backed by the browser's native date input.

Constructors

Constructor
DatePicker
public DatePicker(DateTime? date = null) : base("date", date.HasValue ? FormatDateTime(date.Value) : string.Empty)

Initializes a new instance of this class.

Properties

Property
DatePicker.Date
public DateTime Date

Gets or sets the date value of the component.

Methods

Method
DatePicker.WithBrowserFallback
public DatePicker WithBrowserFallback()

Adds the pattern attribute to the underlying input element for graceful degradation when retrieving the user selected value on older browsers.

Returns

The current instance of the type.

Samples

Comprehensive DatePicker Usage

This sample illustrates various ways of configuring the DatePicker component including setting default values, step increments, minimum and maximum constraints, disabled state, required status, error messages, and custom validations.

See also

© 2026 Tesserae. All rights reserved.