> For the complete documentation index, see [llms.txt](https://legacy-docs.aragon.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.aragon.org/developers/tools/aragonui/data-entry/field.md).

# Field

A wrapper component for form fields.

## Usage <a href="#usage" id="usage"></a>

```jsx
import { Field } from '@aragon/ui'

const App = () => (
  <Field label="Enter name here:">
    <input />
  </Field>
)
```

## Demonstration

![](/files/AhruZIxD1OOzH3zDWz2n)

## Props <a href="#props" id="props"></a>

#### `label` <a href="#label" id="label"></a>

| TYPE     | DEFAULT VALUE |
| -------- | ------------- |
| `String` | None          |

Set a label for your Field.

#### **Example:**

```jsx
const App = () => <Field label="Billing Address">{/* Field Input(s) */}</Field>
```

#### `required` <a href="#required" id="required"></a>

| TYPE      | DEFAULT VALUE |
| --------- | ------------- |
| `Boolean` | None          |

Marks the field as a required field. If not provided, `Field` will attempt to detect if the field is required by checking if any of its children contain a truthy `required` prop.

#### `children` <a href="#children" id="children"></a>

| TYPE                       | DEFAULT VALUE |
| -------------------------- | ------------- |
| `React node` or `Function` | None          |

The field content, usually a form element like `TextInput`.

When a function is passed, it will take an object as parameter containing an `id` key, whose value is set to a unique id that can be passed to the desired form element.

#### Example:

```jsx
<Field label="Phone number">
  {({ id }) => (
    <p>
      <TextInput placeholder="Prefix" value="+44" />
      <TextInput placeholder="Number" value="" id={id} />
    </p>
  )}
</Field>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.aragon.org/developers/tools/aragonui/data-entry/field.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
