Use the Input component
releaseThe Input component provides a text field for users to enter or edit text. It is commonly used in forms, modals, search bars, or cards for inputs like usernames, URLs, emails, and addresses.
Anatomy
An Input component consists of:
- Label: Descriptive text identifying the field.
- Placeholder text: Optional hint text displayed inside the field.
- Input area: The interactive zone for text entry.
- Description: Helper text used to communicate additional information or input state.
Best Practices
- Labels: Always provide clear and concise labels.
- Placeholders: Do not rely on placeholder text as the sole hint, as it disappears when typing. Use the Description for formatting guidance or nudges.
- Validation: Use the
errorMessageprop to provide feedback when input is invalid or incomplete, explaining how to fix the error.