# field.text

Short free text on one line: names, titles, handles

Component: [`<Field>`](https://www.prongs.dev/docs/components/field.md) · Renders: `<input type="text">` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md)

## Example

```tsx
<Field intent="field.text" id="text" name="text" />
```

## Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

| If it is for… | Use |
|---|---|
| Short free text on one line: names, titles, handles | `field.text` (this page) |
| More than one line | [`field.multiline`](https://www.prongs.dev/docs/intents/field/multiline.md) |
| Usernames or handles (rather than [`field.email`](https://www.prongs.dev/docs/intents/field/email.md)) | `field.text` (this page) |
| Other secrets that may be shown, like API keys (rather than [`field.password`](https://www.prongs.dev/docs/intents/field/password.md)) | `field.text` (this page) |
| Codes made of digits, like postcodes or phone numbers (rather than [`field.number`](https://www.prongs.dev/docs/intents/field/number.md)) | `field.text` (this page) |
| Paths or handles (rather than [`field.url`](https://www.prongs.dev/docs/intents/field/url.md)) | `field.text` (this page) |
| Free text (rather than [`field.select`](https://www.prongs.dev/docs/intents/field/select.md)) | `field.text` (this page) |
| A colour typed as text, like a hex code (rather than [`field.color`](https://www.prongs.dev/docs/intents/field/color.md)) | `field.text` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`input.default`](https://www.prongs.dev/docs/intents/ui.md#input-default)

## For registry authors

**Starter intents.** These are the intents `prongs add` puts in your registry, shown in this site’s theme. Yours are your own `registry.ts`: rename, restyle and add to them, and see them with `prongs add gallery`.

What this intent is built from and its entry in `components/prongs/registry.ts`. You only need this to change how it looks or to add an intent like it.

How field.text resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

- [`input.default`](https://www.prongs.dev/docs/intents/ui.md#input-default) — Bordered input box

  ```
  w-full min-w-0 rounded-md border border-input bg-background pl-3
  pr-3 py-2 text-base text-foreground
  placeholder:text-muted-foreground focus-visible:outline-none
  focus-visible:ring-2 focus-visible:ring-ring
  disabled:cursor-not-allowed disabled:opacity-50
  aria-invalid:border-destructive
  ```

- `field.text` (this page) — Short free text on one line: names, titles, handles

Final classes

```
w-full min-w-0 rounded-md border border-input bg-background pl-3
pr-3 py-2 text-base text-foreground
placeholder:text-muted-foreground focus-visible:outline-none
focus-visible:ring-2 focus-visible:ring-ring
disabled:cursor-not-allowed disabled:opacity-50
aria-invalid:border-destructive
```

Element behaviour

```
{ type: 'text' }
```

Definition

```ts
'field.text': {
  kind: 'semantic',
  description: 'Short free text on one line: names, titles, handles',
  refs: ['input.default'],
  binding: { behavior: { type: 'text' } },
  notFor: [{ context: 'more than one line', instead: 'field.multiline' }],
},
```
