Input - Aspect UI

The Input component is a text field used for forms and data entry. It supports different types, icons, validation states, labels, and accessibility enhancements.

Table of Contents#

Input Props#


PropTypeDefaultDescription
labelstring-Optional label text displayed above the input field.
typestring'text'Specifies the type of input element (e.g., text, password, email).
errorstring-Error message displayed below the input field.
iconReactNode<Mail />Optional icon displayed inside the input field.
disabledbooleanfalseDisables the input field if true.
labelClassNamestring''Additional CSS classes for the label element.
iconClassNamestring''Additional CSS classes for the icon element.
classNamestring''Additional CSS classes for the input element.
wrapperClassNamestring''Additional CSS classes for the input wrapper container.
errorClassNamestring''Additional CSS classes for the error message.
passwordIconClassNamestring''Additional CSS classes for the password toggle icon (if applicable).
onChange(event: ChangeEvent<HTMLInputElement>) => void-Callback function triggered when the input value changes.
...restInputHTMLAttributes<HTMLInputElement>-Any other native input attributes will be passed to the input element.