A single-line text input with an icon slot and a clear button. For any short-answer form field.
TextField playground
Install TextField
1. New project? One command installs the package and wires everything - see Installation:
pnpm dlx zyncat-ui init2. Import the component - it loads its own stylesheet:
import { TextField } from '@zyncat/ui/text-field';Usage
import { TextField } from '@zyncat/ui/text-field'; <TextField label="Search projects" leadingIcon={<SearchIcon />} clearable />Compose TextField in your application. No Tailwind or external styling library is required; every value resolves from Zyncat UI's token vocabulary.
TextField props
TextField
Frequently asked questions
Pass error as the message text - the border and message icon switch to the danger color and the message itself slides open under the field through a Collapse instead of jumping into place. error wins over warning, warning wins over success, and success wins over the neutral helper text, so only one shows at a time.
Yes - leadingIcon takes any node and pins it to the left edge, sized to match the control. There's no separate trailing-icon prop, since that slot is reserved for the built-in clear button when clearable is set.
Yes - type accepts text (default), search, email, url or password, and it renders straight through to a native <input type="...">, so browser autofill, validation and password managers behave exactly as they do on plain HTML.