TextField

TextField allows a user to enter a plain text value with a keyboard.

<TextField aria-label="Email">
  <Input placeholder="hello@example.com" />
</TextField>

Installation

npx shadcn@latest add @dotui/text-field

Usage

Use a TextField to allow users to input custom text entries with a keyboard.

import { TextField } from "@/components/ui/text-field";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/field";
<TextField>
	<Label>Email</Label>
	<Input placeholder="hello@example.com" />
</TextField>

Playground

Use the controls below to experiment with different TextField props and see the live preview and code update.

startIcon
endIcon
<TextField>
  <Input />
</TextField>

Examples

Enter your email.
Enter a valid email address.

mirrored text: Hello world!

API Reference

A text field allows a user to enter a plain text value with a keyboard.

PropType
ReactNode | function
union
boolean
boolean
DOMRenderFunction<"div", TextFieldRenderProps>
string
string
function

Last updated on 5/22/2026