export interface DateInputProps { id: string; fieldId: string; classBlock?: string; classModifiers?: string | string[] | null; className?: string; /** flags fields with incorrect value */ propsInError?: { year?: boolean; month?: boolean; day?: boolean; } | null; value?: string; onChange?: (event: { target: { name: string; value: string; }; }) => void; readonly?: boolean; } export declare const DEFAULT_CLASS = "govuk-date-input"; export interface CustomDateFormat { day?: string; month?: string; year?: string; } /** * ## When to use this component Use the date input component when you're asking users for a date they'll already know, or can look up without using a calendar. ## When not to use this component Do not use the date input component if users are unlikely to know the exact date of the event you're asking about. Read more about how to [ask users for dates]. ## How it works The date input component consists of 3 fields to let users enter a day, month and year. The 3 date fields are grouped together in a
with a that describes them, as shown in the examples on this page. This is usually a question, like 'What is your date of birth?'. If you're asking one question per page, you can set the contents of the as the page heading. This is good practice as it means that users of screen readers will only hear the contents once. Read more about [why and how to set legends as headings]. Make sure that any example dates you use in hint text are valid for the question being asked. Never automatically tab users between the fields of the date input because this can be confusing and may clash with normal keyboard controls. ## If you're asking more than one question on the page If you're asking more than one question on the page, do not set the contents of the as the page heading. Read more about [asking multiple questions on question pages]. ### If nothing is entered Highlight the date input as a whole. Say 'Enter [whatever it is]'. For example, 'Enter your date of birth'. ### If the date is incomplete Highlight the day, month or year field where the information is missing. If more than one field is missing information, highlight the date input as a whole. Say '[whatever it is] must include a [whatever is missing]'. For example, 'Date of birth must include a month' or 'Date of birth must include a day and month'. ### If the date entered cannot be correct For example, "13" in the month field cannot be correct. Highlight the day, month or year field with the incorrect information. Or highlight the date as a whole if there's incorrect information in more than one field, or it's not clear which field is incorrect. Say '[Whatever it is] must be a real date'. For example, 'Date of birth must be a real date'. ### If the date is in the future when it needs to be in the past Highlight the date input as a whole. Say '[whatever it is] must be in the past'. For example, 'Date of birth must be in the past'. ### If the date is in the future when it needs to be today or in the past Highlight the date input as a whole. Say '[whatever it is] must be today or in the past'. For example, 'Date of birth must be today or in the past'. ### If the date is in the past when it needs to be in the future Highlight the date input as a whole. Say '[whatever it is] must be in the future'. For example, 'The date your course ends must be in the future'. ### If the date is in the past when it needs to be today or in the future Highlight the date input as a whole. Say '[whatever it is] must be today or in the future'. For example, 'The date your course ends must be today or in the future'. ### If the date must be the same as or after another date Highlight the date input as a whole. Say '[whatever it is] must be the same as or after [date and optional description]'. For example, 'The date your course ends must be the same as or after 1 September 2017 when you started the course'. ### If the date must be after another date Highlight the date input as a whole. Say '[whatever it is] must be after [date and optional description]'. For example, 'The day your course ends must be after 1 September 2017'. ### If the date must be the same as or before another date Highlight the date input as a whole. Say '[whatever it is] must be the same as or before [date and optional description]'. For example, 'The date of Gordon's last exam must be the same as or before 31 August 2017 when they left school'. ### If the date must be before another date Highlight the date input as a whole. Say '[whatever it is] must be before [date and optional description]'. For example, 'The date of Gordon's last exam must be the same as or before 31 August 2017'. ### If the date must be between two dates Highlight the date input as a whole. Say '[whatever it is] must be between [date] and [date and optional description]'. For example, 'The date your contract started must be between 1 September 2017 and 30 September 2017 when you were self-employed'. [ask users for dates]: https://design-system.service.gov.uk/patterns/dates/ [why and how to set legends as headings]: https://design-system.service.gov.uk/get-started/labels-legends-headings/ [asking multiple questions on question pages]: https://design-system.service.gov.uk/patterns/question-pages/#asking-multiple-questions-on-a-page [error message]: https://design-system.service.gov.uk/components/error-message/ */ export declare const DateInput: ({ id, fieldId, classBlock, classModifiers, className, onChange, propsInError, readonly, value, ...attrs }: DateInputProps) => import("react/jsx-runtime").JSX.Element | null;