An official website of the United States government
Here's how you know
Official websites use .gov A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
An official website of the United States government
Here's how you know
Official websites use .gov A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
See Storybook for React guidance of this component.
Style customization
The following CSS variables can be overridden to customize Input/Form components:
CSS variables for text-input
Variable
Default Core Theme Value
--text-input__background-color--disabled
--color-gray-lighter
--text-input__border-width
2px
--text-input__border-width--disabled
2px
--text-input__border-width--error
3px
--text-input__border-color
--color-base
--text-input__border-color--disabled
--color-gray-light
--text-input__border-color--error
--color-error
--text-input__border-color--error--inverse
--color-error-lighter
--text-input__border-color--inverse
--color-black
--text-input__border-radius
--radius-default
--text-input__color
--color-base
--text-input__divider-color
--color-gray-light
--text-input__padding
--spacer-1
--text-input__line-height
1.2999999523162842
--text-input-currency-icon__line-height
--text-input__line-height
--text-input-currency-icon__spacing
20px
Form components
This component also makes use of form field styles, which can be customized by the following variables:
CSS variables for form
Variable
Default Core Theme Value
Guidance
When to use
Use the date input when your user flow does not require separate fields for month, day, and year.
Use the date input for most dates, particularly memorable dates like date of birth, marriage date, health coverage start or end dates, or income start date.
When to consider alternatives
Don't use if users are entering a date within the last year or a future date. Instead, use the date picker.
Usage
Allow users to have flexibility in entering the date, such as allowing one-digit numbers with or without "0" prior to the number, or entering a date with or without slashes to separate month, day, and year.
Users will be able to enter a variety of date formats that automatically format to the correct date format of MM/DD/YYYY. This change happens once the form field loses focus. For example, a user enters a date as "4122020" and it changes to "04/01/2020" once focus leaves the date input.