---
title: "Input"
description: "A single-line text field wired to its label, hint, and error text."
canonical_url: "https://sanity-id-docs.sanity.build/sanity-id/components/input"
md_url: "https://sanity-id-docs.sanity.build/sanity-id/components/input.md"
docs_index: "https://sanity-id-docs.sanity.build/sanity-id/llms.txt"
version: "1.15.2"
---

> Part of the Sanity ID reference. The index of every page is at https://sanity-id-docs.sanity.build/sanity-id/llms.txt.

# Input

A single-line text field wired to its label, hint, and error text.

```tsx
import { Input } from "@sanity/sanity-id/components/input"
```

## Props

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | `string` | yes | — | Unique input ID; connects the input to its label element |
| `error` | `ReactNode` | no | — | Error message displayed below the input |
| `hint` | `ReactNode` | no | — | Hint text displayed below the label |
| `label` | `ReactNode` | no | — | Label displayed above the input |

Also accepts every prop of `ComponentProps<"input">`.

## Usage

```tsx
import { Input } from "@sanity/sanity-id/components/input"

export default () => {
	return (
		<div className="flex flex-col gap-32 max-w-md">
			<Input id="input-example-1" />
			<Input id="input-example-2" placeholder="Input with placeholder" />
			<Input id="input-example-3" label="Input with label" required />
			<Input id="input-example-4" label="Optional input with label" />
			<Input
				id="input-example-5"
				label="Input with long label. Velit excepteur sint nulla est dolore reprehenderit officia sint velit dolor"
			/>
			<Input
				id="input-example-6"
				label="Input with hint"
				hint="Laboris cupidatat in cupidatat incididunt"
				required
			/>
			<Input
				id="input-example-7"
				label="Input with long hint"
				hint="Consectetur elit irure non nulla mollit qui officia proident nostrud non aliqua. Ullamco quis deserunt ut enim deserunt do in mollit est est ea."
				required
			/>
			<Input
				id="input-example-8"
				label="Input with error"
				error="Enim sunt fugiat nostrud amet cupidatat"
				required
			/>
			<Input
				id="input-example-9"
				label="Input with long error"
				error="Do dolore culpa incididunt aute commodo cupidatat proident ea ipsum laborum aute amet elit. Dolore ipsum exercitation sit mollit occaecat amet duis sint consequat aute elit."
				required
			/>
		</div>
	)
}
```

