- Docs
- Components
- Forms
Text field
A labelled text input: the default form row. A label always; a placeholder is only an example.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<input>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Playground
Every prop, live, and the code it takes.
We send the invite here.
import { TextField } from "@qeetrix/react";
<TextField
label="Work email"
placeholder="e.g. priya@acme.in"
description="We send the invite here."
/>02
Optional, invalid, disabled, read-only
Optional is marked; required isn't. An error replaces the description while it shows.
This PAN is already registered.
<Stack gap="lg">
<TextField label="Trade name" optional placeholder="e.g. Acme" />
<TextField label="PAN" defaultValue="ABCDE1234F" error="This PAN is already registered." />
<TextField label="Tenant ID" disabled defaultValue="ten_8f2c1a9b3e47" />
<TextField label="Client ID" readOnly defaultValue="qid_live_8f2c1a9b3e47" />
</Stack>03
Icon and affixes
A leading icon, and text before or after the value: ₹, .qeet.in.
.qeet.in
₹
<Stack gap="lg">
<TextField label="Work email" type="email" icon={MailIcon} placeholder="e.g. priya@acme.in" />
<TextField label="Subdomain" defaultValue="acme" endAdornment=".qeet.in" />
<TextField label="Credit limit" defaultValue="1,24,500" startAdornment="₹" />
</Stack>04
With help
description sits under the field; help opens behind ⓘ, for a setting that needs explaining.
Exactly as your app sends it.
<TextField
label="Redirect URI"
placeholder="e.g. https://payroll.acme.in/callback"
description="Exactly as your app sends it."
help={<>Where Qeet ID sends people back after they sign in. <Link href="#redirects">About redirect URIs</Link></>}
/>05
Validation
validate checks the value; validationMode="onBlur" says so as you leave the field.
<TextField
label="Work email"
type="email"
validationMode="onBlur"
validate={(value) => (value.endsWith("@acme.in") ? null : "Use your acme.in email, like priya@acme.in.")}
/>06
In a form
Rows on the grid; autoComplete and type let the browser help.
<Grid columns={2} gap="lg">
<TextField label="Full name" autoComplete="name" defaultValue="Rahul Verma" />
<TextField label="Work email" type="email" autoComplete="email" defaultValue="rahul@acme.in" />
<TextField label="Company" autoComplete="organization" defaultValue="Acme Pvt Ltd" />
<TextField label="Phone" optional type="tel" autoComplete="tel" placeholder="e.g. 98765 43210" />
</Grid>07
In Hindi
Its words, "(वैकल्पिक)" among them, come from QeetrixProvider.
<QeetrixProvider locale="hi-IN" messages={hi}>
<TextField label="कानूनी नाम" defaultValue="Acme Private Limited" />
<TextField label="व्यापार नाम" optional placeholder="जैसे Acme" />
</QeetrixProvider>