Text inputs with modifiers that allow the ability to input data in a structured format.
| Name | Description | Default |
|---|---|---|
| onClick | Callback function to handle clicks events on the copy button. MouseEventHandler<Element> | - |
| disabled | @deprecated use The All DLS components are designed to use the boolean | - |
| aria-disabled | If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled". Booleanish | - |
| label | Text that's used as the visual and accessible label for the component. If not provided, hide the component's built-in label. string | - |
| autoComplete | Must be defined when the form control collects user personal data. Attribute value must match the tokens defined in input purposes section string | - |
| name | The name attribute of the input field, will default to the id provided string | - |
| required | Flag to allow for default validation message to show boolean | - |
| value | The value of the input field (controlled) string | number | readonly string[] | - |
| onChange | The onChange event handler to attach to the input field (controlled) ChangeEventHandler<HTMLInputElement> | - |
| id* | The ID for the input field, necessary for accessibility and labeling. string | - |
| aria-describedby | The id of the container of the text describing the input, intended for custom hint text string | - |
| aria-labelledby | The id of a label, which provides an accessible name for the component Identifies the element (or elements) that labels the current element. @see aria-describedby. string | - |
| onError | Callback function triggered when the copy operation fails. (() => void) | - |
| inputSlot | @ignore undefined | - |
| isVisuallyDisabled | @ignore undefined | - |
| statusMessageId | @ignore undefined | - |
| status | Default, error, or success state. Will use the value provided by the context when wrapped in a FieldControlStatus | - |
| statusMessage | The status message to be displayed if status is 'success' or 'error'. string | - |
| containerProps | Props to be spread onto the parent div container Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | - |
| hint | Hint text to assist the user, displayed above the input. string | - |
| isHintVisuallyHidden | If true, visually hides the hint text (it will still be accessible to screen readers) boolean | - |
| timeout | Timeout duration in milliseconds before ressetting the status to default. number | - |
| onSuccess | Callback function triggered when the copy operation is successful. (() => void) | - |
| onTimeout | Callback function triggered when the timeout elapses. (() => void) | - |
| copyButtonProps | Other props to be spread onto the copy button. Omit<IconButtonProps, "onClick" | "disabled" | "aria-disabled" | "screenReaderLabel"> | - |
| labelOverrides | Overrides for labels that have been defaulted in the component. CopyLinkInputLabelOverrides | - |
| Name | Description | Default |
|---|---|---|
| id* | The ID for the input field, necessary for accessibility and labeling. string | - |
| value | Value to be shown in the currency input. The value will be reformatted to the proper locale string based on the props supplied. e.g. if locale is "en-US" and currency is "USD" then "3" -> "3.00"; "2143.22" -> "2,143.22" string | number | - |
| onChange | The onChange event handler (controlled). ChangeEventHandler<HTMLInputElement> | - |
| onBlur | The onBlur event handler (controlled). Should be used to get the normalized (non-localized) value as a number.
First argument to function is event object.
Second argument to function is object with the following keys:
((event: FocusEvent<HTMLInputElement, Element>, params: CurrencyInputOnBlurParams) => void) | - |
| disabled | @deprecated use The All DLS components are designed to use the boolean | - |
| aria-disabled | If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled". Booleanish | - |
| label | Text that's used as the visual and accessible label for the component. If not provided, hide the component's built-in label. string | - |
| autoComplete | Must be defined when the form control collects user personal data. Attribute value must match the tokens defined in input purposes section string | - |
| name | The name attribute of the input field, will default to the id provided string | - |
| required | Flag to allow for default validation message to show boolean | - |
| defaultValue | Default value to be shown in the field. Will be reformatted to the proper locale string. e.g. "3" -> "3.00"; "2143.22" -> "2,143.22" string | number | - |
| aria-describedby | The id of the container of the text describing the input, intended for custom hint text string | - |
| aria-labelledby | The id of a label, which provides an accessible name for the component Identifies the element (or elements) that labels the current element. @see aria-describedby. string | - |
| inputSlot | @ignore undefined | - |
| isVisuallyDisabled | @ignore undefined | - |
| statusMessageId | @ignore undefined | - |
| status | Default, error, or success state. Will use the value provided by the context when wrapped in a FieldControlStatus | - |
| statusMessage | The status message to be displayed if status is 'success' or 'error'. string | - |
| containerRef | A ref to the container element RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | - |
| containerProps | Props to be spread onto the parent div container Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | - |
| resetValue | If passed, the input value will be reset to this number when the input is cleared during the onBlur event. The value will be reformatted to the proper locale string based on the props supplied. e.g. if locale is "en-US" and currency is "USD" then "3" -> "3.00"; "2143.22" -> "2,143.22" string | number | - |
| currency | ISO 4217 currency code string | - |
| locale | BCP 47 language tag string | - |
| showFractions | If boolean | - |
| shouldUseCurrencySymbol | If boolean | - |
| hint | Hint text to use inbuilt hint instead of a custom label string | - |
| isHintVisuallyHidden | If true, visually hides the hint text (it will still be accessible to screen readers) boolean | - |
| Name | Description | Default |
|---|---|---|
| label | Text that's used as the visual and accessible label for the component. If not provided, hide the component's built-in label. The visible label for the DateInput component. string | - |
| aria-labelledby | The id of a label, which provides an accessible name for the component string | - |
| id* | The ID for the input field, necessary for accessibility and labeling. string | - |
| name | The name used for form submission. string | - |
| hint | Hint text to assist the user, displayed below the input. string | - |
| isHintVisuallyHidden | If true, visually hides the hint text (it will still be accessible to screen readers) boolean | - |
| value | Controlled value for the date input in ISO format ('YYYY-MM-DD') or Date object. string | - |
| defaultValue | Default value for uncontrolled usage in ISO format ('YYYY-MM-DD') or Date object. string | - |
| onChange | Callback fired when the date changes.
@param event the event associated with the individual input field that triggered the change.
@param date the date in ISO format ( ((event: ChangeEvent<HTMLInputElement>, date: string) => void) | - |
| onBlur | Callback fired when the date input loses focus. Only gets called if the focus is not moving to another input field within the DateInput component. @param event the event associated with the individual input field that triggered the blur. ((event: FocusEvent<HTMLInputElement, Element>) => void) | - |
| lang | BCP 47 language tag to format the date input fields according to different cultural norms. string | - |
| showPlaceholder | Whether to show placeholders in the input fields boolean | - |
| className | Additional CSS class names to apply to the DateInput container. string | - |
| fieldsToShow | Specifies which date fields to show and in what order. ("day" | "month" | "year")[] | - |
| aria-describedby | ID of element providing additional description of the date input string | - |
| autocompleteSettings | AutoComplete settings for each of the input field parts DateInputAutocompleteSettings | - |
| required | If true, indicates that the consumer must specify a value for the input before the owning form can be submitted. boolean | - |
| children | @ignore For DLS Internal use only. The children to position in the input wrapper. ReactNode | - |
| labelOverrides | Overrides for labels that have been defaulted in the component. DateInputLabelOverrides | - |
| disabled | @deprecated use The All DLS components are designed to use the boolean | - |
| aria-disabled | If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled". Booleanish | - |
| status | Default, error, or success state. Will use the value provided by the context when wrapped in a FieldControlStatus | - |
| statusMessage | The status message to be displayed if status is 'success' or 'error'. string | - |
| reactlytics | ReactlyticsProp | - |
| Name | Description | Default |
|---|---|---|
| onBlur | Handler for focus loss events from any focusable HTML element within the component. ((event: FocusEvent<HTMLElement, Element>) => void) | - |
| disabled | @deprecated use The All DLS components are designed to use the boolean | - |
| aria-disabled | If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled". Booleanish | - |
| label | Text that's used as the visual and accessible label for the component. If not provided, hide the component's built-in label. The visible label for the PasswordInput component. string | - |
| autoComplete | Must be defined when the form control collects user personal data. Attribute value must match the tokens defined in input purposes section string | - |
| name | The name attribute of the input field, will default to the id provided string | - |
| required | Flag to allow for default validation message to show boolean | - |
| value | The value of the input field (controlled) string | number | readonly string[] | - |
| onChange | The onChange event handler to attach to the input field (controlled) ChangeEventHandler<HTMLInputElement> | - |
| defaultValue | The default value of the input field (uncontrolled) string | number | readonly string[] | - |
| id* | The ID for the input field, necessary for accessibility and labeling. string | - |
| aria-describedby | The id of the container of the text describing the input, intended for custom hint text string | - |
| aria-labelledby | The id of a label, which provides an accessible name for the component Identifies the element (or elements) that labels the current element. @see aria-describedby. string | - |
| inputSlot | @ignore undefined | - |
| isVisuallyDisabled | @ignore undefined | - |
| statusMessageId | @ignore undefined | - |
| childrenPosition | Positions the slot (children) to the left or right of the other content within the container "start" | "end" | - |
| status | Default, error, or success state. Will use the value provided by the context when wrapped in a FieldControlStatus | - |
| statusMessage | The status message to be displayed if status is 'success' or 'error'. string | - |
| containerRef | A ref to the container element RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | - |
| childrenContainerProps | Props to be spread onto the span containing the children Omit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> | - |
| containerProps | Props to be spread onto the parent div container Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | - |
| hint | Hint text to assist the user, displayed above the input. string | - |
| isHintVisuallyHidden | If true, visually hides the hint text (it will still be accessible to screen readers) boolean | - |
| defaultShouldShowPassword | Shows the password by default. boolean | - |
| shouldShowPassword | Controlled visibility of the password boolean | - |
| onShowPasswordChange | Handler for changes in password visibility. ((isVisible: boolean) => void) | - |
| labelOverrides | Overrides for labels that have been defaulted in the component. PasswordInputLabelOverrides | - |
| Name | Description | Default |
|---|---|---|
| value | Value to be shown in the PhoneInput (controlled).
The value will be reformatted when focus is not on the PhoneInput.
e.g. if string | number | - |
| onChange | The onChange event handler called when the input is changed. ((event: ChangeEvent<HTMLInputElement>, selectedOption?: SelectOption) => void) | - |
| onBlur | The onBlur event handler called when the input is blurred. ((event: FocusEvent<HTMLInputElement, Element>, selectedOption?: SelectOption) => void) | - |
| onFocus | The onFocus event handler called when the input is focused. ((event: FocusEvent<HTMLInputElement, Element>) => void) | - |
| disabled | @deprecated use The All DLS components are designed to use the boolean | - |
| aria-disabled | If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled". Booleanish | - |
| label | Text that's used as the visual and accessible label for the component. If not provided, hide the component's built-in label. string | - |
| name | The name attribute of the input field, will default to the id provided string | - |
| required | Flag to allow for default validation message to show boolean | - |
| defaultValue | Default value to be shown in the PhoneInput (uncontrolled).
The value will be reformatted when focus is not on the PhoneInput.
e.g. if string | number | - |
| aria-describedby | The id of the container of the text describing the input, intended for custom hint text string | - |
| aria-labelledby | The id of a label, which provides an accessible name for the component Identifies the element (or elements) that labels the current element. @see aria-describedby. string | - |
| inputSlot | @ignore undefined | - |
| isVisuallyDisabled | @ignore undefined | - |
| statusMessageId | @ignore undefined | - |
| status | Default, error, or success state. Will use the value provided by the context when wrapped in a FieldControlStatus | - |
| statusMessage | The status message to be displayed if status is 'success' or 'error'. string | - |
| containerRef | A ref to the container element RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | - |
| childrenContainerProps | Props to be spread onto the span containing the children Omit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> | - |
| containerProps | Props to be spread onto the parent div container Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | - |
| callingCode | The phone number calling code, e.g. "1", "44" @ignore string | number | - |
| phoneFormat | The phone number format, e.g. "### ### ####" @ignore string | - |
| locale | BCP 47 language tag e.g. "en-US", "de-DE" @ignore string | - |
| country | Screenreader label for country flag @ignore string | - |
| showCallingCode | If true, will show calling code on the single country PhoneInput @ignore boolean | - |
| showFlag | If true, will show flag (if available) associated with the country in the boolean | - |
| selectOptions | An array of objects with the following properties:
SelectOption[] | - |
| selectedLocale | BCP 47 language tag e.g. "en-US", "de-DE" of the selected option (controlled) @ignore string | - |
| defaultSelectedLocale | BCP 47 language tag e.g. "en-US", "de-DE" of the default selected option (uncontrolled) @ignore string | - |
| selectId | The id for the country string | - |
| countrySelectProps | Props to be spread onto the multi-country select. @ignore Omit<Omit<DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & { ...; }, "id" | ... 5 more ... | "onClick"> | - |
| inputId* | The id for the input field string | - |
| hint | Hint text for input string | - |
| isHintVisuallyHidden | If true, visually hides the hint text (it will still be accessible to screen readers) boolean | - |
| onSelectChange | The onChange event handler called when the multi-country select is changed. ((event: ChangeEvent<HTMLSelectElement>, selectedOption?: SelectOption) => void) | - |
| onSelectBlur | The onBlur event handler called when the multi-country select is blurred. ((event: FocusEvent<HTMLSelectElement, Element>, selectedOption?: SelectOption) => void) | - |
| labelOverrides | Overrides for labels that have been defaulted in the component. PhoneInputLabelOverrides | - |
| reactlytics | ReactlyticsProp | - |
| Name | Description | Default |
|---|---|---|
| disabled | @deprecated use The All DLS components are designed to use the boolean | - |
| aria-disabled | If true, styles component as disabled and prevents interactivity. Screen reader reads as "dimmed" or "disabled". Booleanish | - |
| label | Text that's used as the visual and accessible label for the component. If not provided, hide the component's built-in label. string | - |
| autoComplete | Must be defined when the form control collects user personal data. Attribute value must match the tokens defined in input purposes section string | - |
| name | The name attribute of the input field, will default to the id provided string | - |
| required | Flag to allow for default validation message to show boolean | - |
| type | The type of the input component, defaults to 'text' HTMLInputTypeAttribute | - |
| value | The value of the input field (controlled) string | number | readonly string[] | - |
| onChange | The onChange event handler to attach to the input field (controlled) ChangeEventHandler<HTMLInputElement> | - |
| defaultValue | The default value of the input field (uncontrolled) string | number | readonly string[] | - |
| id* | The id of the input component, used to associate the input with the built-in accessible label and hint string | - |
| aria-describedby | The id of the container of the text describing the input, intended for custom hint text string | - |
| aria-labelledby | The id of a label, which provides an accessible name for the component Identifies the element (or elements) that labels the current element. @see aria-describedby. string | - |
| inputSlot | @ignore undefined | - |
| isVisuallyDisabled | @ignore undefined | - |
| statusMessageId | @ignore undefined | - |
| childrenPosition | Positions the slot (children) to the left or right of the other content within the container "start" | "end" | - |
| status | Default, error, or success state. Will use the value provided by the context when wrapped in a FieldControlStatus | - |
| statusMessage | The status message to be displayed if status is 'success' or 'error'. string | - |
| containerRef | A ref to the container element RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | - |
| containerProps | Props to be spread onto the parent div container Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> | - |
| hint | Hint text to use inbuilt hint instead of a custom label string | - |
| isHintVisuallyHidden | If true, visually hides the hint text (it will still be accessible to screen readers) boolean | - |
| tooltip | The slot for the tooltip ReactElement<({ id, placement: placementProp, disableHover, isOpen: openProp, defaultIsOpen, onIsOpenChange, children, shouldCreatePortal, }: TooltipProps) => Element, string | JSXElementConstructor<any>> | - |
| reactlytics | ReactlyticsProp | - |
Connect with the DLS Team on Slack or by email.
Check out additional resources.