1. Docs
  2. Components
  3. TextField

TextField

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

Installation

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

Single import

import { TextField } from "~/components/ui/text-field";
<TextField.Provider>
  <TextField.Root>
    <TextField.Slot />
    <TextField.Input />
    <TextField.Slot />
  </TextField.Root>
</TextField.Provider>

Multiple imports

import {
  TextFieldProvider,
  TextFieldRoot,
  TextFieldSlot,
  TextFieldInput,
} from "~/components/ui/text-field";
<TextFieldProvider>
  <TextFieldRoot>
    <TextFieldSlot />
    <TextFieldInput />
    <TextFieldSlot />
  </TextFieldRoot>
</TextFieldProvider>

Examples

Default

With Icon

With Label

Password

Form

This is your public display name.