# @spark-web/field

> --- title: Field isExperimentalPackage: false ---

Latest version **5.3.2** (published 2026-04-28) · 0 weekly downloads

## Install

```sh
npm install @spark-web/field
pnpm add @spark-web/field
yarn add @spark-web/field
bun add @spark-web/field
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.3.2 |
| Published | 2026-04-28 |
| First published | 2022-04-20 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 9 |
| Unpacked size | 56.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | brighte, brighte-release-bot |

## Links

- npm: https://www.npmjs.com/package/@spark-web/field
- Repository: https://github.com/brighte-labs/spark-web
- Homepage: https://github.com/brighte-labs/spark-web#readme
- Issues: https://github.com/brighte-labs/spark-web/issues
- npm.io page: https://npm.io/package/@spark-web/field

## Dependencies (9)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.25.0
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.14.0
- [@spark-web/box](https://npm.io/package/@spark-web/box.md) ^6.0.1
- [@spark-web/a11y](https://npm.io/package/@spark-web/a11y.md) ^5.3.0
- [@spark-web/icon](https://npm.io/package/@spark-web/icon.md) ^5.1.0
- [@spark-web/text](https://npm.io/package/@spark-web/text.md) ^5.3.1
- [@spark-web/stack](https://npm.io/package/@spark-web/stack.md) ^5.1.1
- [@spark-web/theme](https://npm.io/package/@spark-web/theme.md) ^5.13.0
- [@spark-web/utils](https://npm.io/package/@spark-web/utils.md) ^5.1.0

## Recent versions

- 5.3.2 (latest) — 2026-04-28
- 0.0.0-snapshot-release-20260827022754 (snapshot-release) — 2026-08-27
- 5.2.0-rc.0 (rc) — 2025-07-24
- 5.3.1 — 2026-04-14
- 0.0.0-snapshot-release-20260409073509 — 2026-04-09
- 0.0.0-snapshot-release-20260409063015 — 2026-04-09
- 0.0.0-snapshot-release-20260409051926 — 2026-04-09
- 0.0.0-snapshot-release-20260409001813 — 2026-04-09
- 5.3.0 — 2026-01-15
- 5.2.0 — 2026-01-08
- 5.1.3 — 2025-10-20
- 5.1.1 — 2025-04-16
- 5.1.0 — 2025-03-25
- 5.0.0 — 2025-02-10
- 5.0.0-rc.31 — 2025-02-10
- … 43 more at https://npm.io/package/@spark-web/field/versions

## README

---
title: Field
isExperimentalPackage: false
---

Using context, the field component connects the label, description, and message
to the input element.

```jsx live
<Field label="Label">
  <TextInput />
</Field>
```

## Example

### Label

Each field must be accompanied by a label. Effective form labeling helps users
understand what information to enter into an input.

Using placeholder text in lieu of a label is sometimes employed as a
space-saving method. However, this is not recommended because it hides context
and presents accessibility issues.

```jsx live
<Field label="Name">
  <TextInput />
</Field>
```

#### Label visibility

The label must always be provided for assistive technology, but you may hide it
from sighted users when the intent can be inferred from context.

```jsx live
<Stack gap="xlarge">
  <Field label="Name" labelVisibility="hidden">
    <TextInput placeholder="hidden" />
  </Field>
  <Columns gap="small">
    <Field label="Name">
      <TextInput placeholder="visible" />
    </Field>
    <Field label="Name" labelVisibility="reserve-space">
      <TextInput placeholder="reserve-space" />
    </Field>
  </Columns>
</Stack>
```

#### Secondary label

Provide additional context, typically used to indicate that the field is
optional.

```jsx live
<Field label="Name" secondaryLabel="(Optional)">
  <TextInput />
</Field>
```

### Adornment

Optionally provide a utility or contextual hint, related to the field.

```jsx live
<Field
  label="Username"
  adornment={
    <Text>
      <TextLink href="#">Forgot username?</TextLink>
    </Text>
  }
>
  <TextInput />
</Field>
```

### Description

Provides pertinent information that assists the user in completing a field.
Description text is always visible and appears underneath the label. Use
sentence-style capitalisation, and in most cases, write the text as full
sentences with punctuation.

```jsx live
<Field
  label="Email"
  description="We take your privacy seriously. We will never give your email to a third party."
>
  <TextInput type="email" />
</Field>
```

### Message and tone

The “message” is used to communicate the status of a field, such as an error
message. This will be announced on focus and can be combined with a “tone” to
illustrate intent.

```jsx live
<Stack gap="xlarge">
  <Field label="Label" tone="critical" message="Critical message">
    <TextInput />
  </Field>
  <Field label="Label" tone="positive" message="Positive message">
    <TextInput />
  </Field>
  <Field label="Label" tone="neutral" message="Neutral message">
    <TextInput />
  </Field>
</Stack>
```

### Disabled

Mark the field as disabled by passing true to the disabled prop.

```jsx live
<Field label="Label" secondaryLabel="Secondary label" disabled>
  <TextInput value="Text in disabled field" />
</Field>
```

## Props

<PropsTable displayName="Field" />

[data-attribute-map]:
  https://github.com/brighte-labs/spark-web/blob/e7f6f4285b4cfd876312cc89fbdd094039aa239a/packages/utils/src/internal/buildDataAttributes.ts#L1

---
_Source: https://npm.io/package/@spark-web/field · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
