HelpText
Molecule
Usage
It is used to hint users with the corresponding input field such as to the type of input to be entered, type of file formats they need to upload, restrictions on input fields, hints on best passwords or validate the input after the user has entered it. Usually, but not always, used within another input component in Forms, such as Text Input, Select or similar. They should not be used as the main source of guidance to fulfill the form but rather as a secondary or tertiary after Form Label and placeholder. Help text can also be used to dynamically validate the input entered by user, and inform user when the input is valid, or invalid.
It can also be used as a standalone component that refers to the the group of fields or the whole Form element, guiding user on the whole Form, validating the input of the whole form inputs in aggregation, for example presenting Invalid type of Help text beneath the form element in Login forms that refers to the combination of username and password being invalid and not necessarily either one.
Playground
This field can not be empty. Please provide password or try Forget Password option.
<
HelpText
category
=
"info"
text
=
"This field can not be empty. Please provide password or try Forget Password option."
helpTextIcon
/>
Anatomy
- Container - simply the container.
- Icon - optional for explaining the message.
- Text - describes the help, validation result and optionally gives hints to solve failures in validation.
States
- Default, Invalid, Warning, Validated, and Locked
Properties
ts
export type HelpTextCategory = "invalid" | "validated" | "info" | "warning";
export interface HelpTextProps extends TooltipProps {
text: string;
category: HelpTextCategory;
helpTextIcon?: boolean;
disabled?: boolean;
icon?: IconName;
}