Input
A text field with five built-in variants - name, email, username, password, and plain text. Each ships with its own icon, placeholder, blur validation, and an error-shake animation.
Installation
npx stepwise-ui add input
Usage
Props
Extends all native <input> props except id and type (managed internally). Works as both controlled and uncontrolled.
PropTypeDescription
variant"text" | "name" | "email" | "username" | "password"Controls input type, default label, default placeholder, built-in icon, and blur validation. Default: "text".
labelstringLabel shown above the field. Omit to use the variant default (e.g. "Full Name"). Pass an empty string to hide the label entirely.
placeholderstringPlaceholder text inside the field. Omit to use the variant default (e.g. "name@example.com" for email).
showIconbooleanShow or hide the variant's built-in icon. Default: true for all named variants. Always false for "text".
iconSide"left" | "right"Which side to place the icon. Default: "left". The password eye-toggle is always on the right regardless.
iconReactNodeCustom icon node - replaces the variant default while respecting showIcon and iconSide.
errorstringExternal error message (from a server or form library). Overrides built-in validation and triggers the shake animation.
hintstringHelper text shown below the field. Hidden when an error is active.
disabledbooleanDims the field and blocks all interaction.
classNamestringApplied to the outer flex wrapper - useful for controlling width or margin.