Skip to Content
Puzzle

Text Input

Enter text, email addresses, phone numbers, or passwords.

Import

import { TextInput } from "@puzzle-ui/ui";

Types and affixes

email and phone provide default leading icons; phone renders a native tel input. Password fields include a show/hide button. Explicit prefix or suffix replaces the default affix; null removes it.

390 × 480

API

PropTypeDefaultDescription
type"text" | "email" | "password" | "phone""text"Input purpose.
prefix, suffixReactNodeType-specificLeading and trailing content.
value, defaultValueNative input value-Controlled or initial value.
onChangeChangeEventHandler<HTMLInputElement>-Native change event.
disabledbooleanfalseDisables input and password visibility button.
classNamestring-Class on the outer span.

Other native input attributes and ref apply to the input. Prefix content is decorative and hidden from assistive technology; keep essential units or instructions in the label/description. Always provide a label.

;