Skip to content

Date Field

Overview

Date allows the user to to input date in a format which can be stored accurately. Use the date component to help users enter a memorable date or one they can easily look up.

The date component supports a number of common date formats, which can be seen below. Unlike our Date Time field component Date only returns a consistently formatted date string. If you need to return an ISO 8601 datetime then make use of the Date Time field component instead.

When to use
  • Use Date if the entry requires an entry in day, month, year, day and month, month and year.
When not to use
  • Do not use Date if it is purely a number value which needs to be entered, e.g. ‘11’.

Interactive demo

The demo below allows you to preview the component. You can play with its props, variations, configuration options and dive into its events and even see them trigger in the event log tab.

MedKit Date Field
Error
string
Array<string>
Errors to display for the input.
Error Hidden
boolean
false
Only display the red border but not the error text.
Format
DateFormat
The format for the date input.
Help Text
string
Array<string>
The help text to display for the input.
Label
string
Required
The label to be shown above the input.
Label Hidden
boolean
false
Only display the label for screen readers.
Required
boolean
false
If the field is required.

Default

Supported date formats

With Help Text

A useful hint for the user

Figma Library

You can find the component in our MedKit Figma library.