AstraUI

Components

Input

A field where users can enter data or information.

Default Input

This is a hint text.

Input with Icon

This is a hint text.

Input with Error

This is an error message.

Password Input

Password Input with Icon (Toggle Visibility)

Disabled Input

Props

NameTypeDefaultDescription
type'text' | 'password' | 'email''text'The type of input.
valuestring-The value of the input.
onChangeReact.ChangeEvent-The function to call when the input value changes.
placeholderstring-The placeholder text for the input.
labelstring-The label for the input.
hintstring-A hint for the input.
errorstring-An error message for the input.
iconReact.ReactNode-An optional icon to display inside the input.
classNamestring-Additional class names for the wrapper div.
inputClassNamestring-Additional class names for the input element.
labelClassNamestring-Additional class names for the label.
hintClassNamestring-Additional class names for the hint.
errorClassNamestring-Additional class names for the error message.
disablebooleanfalseFlag to disable the input.

Best Practices

  • Use clear and intuitive icons that represent the action they perform.
  • Use labels to provide context for the input fields.
  • Include hints to guide the user in entering the correct information.
  • Display error messages to help users correct their input.