ValyroUI Русская версия

Text Input

Text fields. Free, MIT · Forms and input › Text

Single-line text field. className and style go to the field wrapper, every other prop (including ref, id, aria-*) to the native <input>. type="password" adds a show/hide toggle.

Installation

npx valyro-cli@latest add text-input
npx shadcn@latest add https://valyro.xyz/r/text-input.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { TextInput } from 'valyro-ui';

Props

PropTypeDefault
size'sm' | 'md' | 'lg''md'Field height and text size.
leftIconReactNodeIcon inside the field, before the text.
rightIconReactNodeIcon inside the field, after the text and the clear/password buttons.
prefixReactNodeAttached text before the input, e.g. "https://".
suffixReactNodeAttached text after the input, e.g. ".vercel.app".
invalidbooleanfalseError border and aria-invalid on the input (an explicit aria-invalid wins).
clearablebooleanfalseShows a clear button while the input has a value.
labelsPartial<TextInputLabels>Accessible names of the clear and show/hide password buttons.

Related components

Previous: Tour · Next: Textarea · All Forms and input