Skip to main content

Anatomy

The Date Field consists of six primary elements that work together to allow users to enter a date.
DateField
Anatomy
  1. Label
  2. DateField Indicator
  3. Field
  4. Placeholder
  5. Hint on expected format
  6. Value

Options

The Date Field supports range selection and multiple size configurations to accommodate various date entry scenarios.

Range

DateField options
range
Enables date range selection

Sizes

DateField options
sizes
SizeHeight
Small32px
Medium (Default)40px
Large48px

Behavior

The Date Field responds to user interaction with distinct visual states and calendar popover interactions.

Visual States

Default

DateField visual states
default

Disabled

DateField visual states
disabled

Read-only

DateField visual states
read-only

Error

DateField visual states
error

Open

DateField state
open

Tab order

OrderElement
Initialfield
1Calendar: if there is selected date, selected date, otherwise today’s date
2Today Button
3Previous month Button
4Next month Button

Usage Guidelines

Use the Date Field when users need to enter a date as string or with a calendar popover.

When to Use

Single Date Selection: Opt for a single date picker when users need to select a specific date, such as a birthdate or card expiration date. The calendar can be helpful to see the relationship between dates. Date Range Selection: Use a date range picker when users need to select a start and end date, often for activities spanning multiple days. It provides a clear visual representation of the time span and allows for efficient selection of both dates simultaneously.

How to Use

Read-only Date Field

Use a read-only Date Field when users can review but not alter the value of a Date Field. Unlike disabled Date Fields, read-only Date Fields still allow users to focus the input, copy and paste text, are accessible via screen readers, and maintain good contrast for readability.

Disabled

Use a disabled Date Field when users cannot edit the form field.

Format Hint

Hints should help users determine the expected format. Do not use the placeholder to show the expected format.

Labels and Help

For guidance on labels and help text, check out our Labels and Help pattern.

Date Field Validation

For form validation guidance, check out our Form Errors and Validation pattern.

Content

Content within the Date Field should clearly communicate the expected date format and provide helpful hints.

Keyboard Interaction

Users can navigate the Date Field using standard keyboard controls.
KeyDescription
page upfocused previous month same day
page downfocused next month same day
shift + page upfocused previous year same month and day
shift + page downfocused next year same month and day

Accessibility

Anvil provides most of the accessibility needs for Date Field out of the box, and only needs some additional considerations for library users.
Last modified on January 23, 2026