Input

A text input component with validation states and icon support.

Installation

bash
npx @smicolon/cli add input

Run init once per project before adding components. See Installation.

Preview

Variants

Sizes

With Icons

Props

PropTypeDefaultDescription
variant"default" | "error" | "success""default"Visual style for validation.
inputSize"sm" | "default" | "lg""default"Field size.
startIconReactNode—Icon at the start of the field.
endIconReactNode—Icon at the end of the field.
placeholderstring—Text shown while empty.
typestring"text"Input type, such as email.
disabledbooleanfalseDisables the field and dims it.
valuestring—Field value. Use it with onChange.
onChange(event) => void—Called when the text changes.
classNamestring—Extra classes for the component.