# Field

> Label, description and error message around a form control.

- Category: [Inputs & forms](https://tarve.dev/docs.md#inputs)
- Import: `import { Field } from "@tarve/core";`
- Props type: `FieldProps`
- Source: [packages/core/src/form-controls.ts:125](https://github.com/omarcosr/tarve/blob/main/packages/core/src/form-controls.ts#L125)

## Usage

```tsx title="Field.tsx"
import { Field, Input } from "@tarve/core";

let username = "ad";

<Field
  label="Username"
  description="This is your public display name."
  error={username.length < 3 ? "Use at least 3 characters." : undefined}
  required
>
  <Input
    value={username}
    onChange={(value) => {
      username = value;
    }}
  />
</Field>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `description` | `string` | — |  |
| `disabled` | `boolean` | — |  |
| `error` | `string` | — |  |
| `label` | `string` | — |  |
| `required` | `boolean` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [InputOTP](https://tarve.dev/docs/components/InputOTP.md) · Next: [Checkbox](https://tarve.dev/docs/components/Checkbox.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Field · Index for agents: https://tarve.dev/llms.txt
