Input
The Input component provides a customizable input field that can be used to collect user information, such as name, email, password, or other types of data.
Usage Guidelines
Basic Input
Use the Input component to collect user information, such as name, email, password, or other types of data.
<Input placeholder="Email address" type="email" />Prefix
Use the prefix prop to add a prefix to the input field. The prefix can be used to provide additional context.
<Input align="right" placeholder="0.00" prefix="$" value="9.00" />Suffix
Use the suffix prop to add a prefix to the input field. The suffix can be used to provide additional context.
<Input placeholder="Search for product" suffix={<Icon icon={SearchIcon} />} />States
Error:
The error state of the input field is used to indicate that the user has entered invalid information. The error state is typically used to indicate that the user has entered invalid information, such as an invalid email address or password.
<Input type="password" value="secret-password" state="error" />Success:
The success state of the input field is used to indicate that the user has entered valid information. The success state is typically used to indicate that the user has entered valid information, such as a valid email address or password.
<Input type="password" value="secret-password" state="success" />Warning:
The warning state of the input field is used to indicate that the user has entered information that may be incorrect or incomplete. The warning state is typically used to indicate that the user has entered information that may be incorrect or incomplete, such as an incomplete email address or password.
<Input type="email" value="me@example.com" state="warning" />Props
Change the alignment of the input text.
Render the input with a prefix.
Changes the appearance of the input to indicate an error, success, or warning state.
Render the input with a suffix.
The CSS className for the element. A function may be provided to compute the class based on component state.
The inline style for the element. A function may be provided to compute the style based on component state.
Temporary text that occupies the text input when it is empty. See MDN.
Handler that is called when a hover interaction starts.
Handler that is called when a hover interaction ends.
Handler that is called when the hover state changes.