Skip to main content

Design system components

FieldShell

The frame every text and choice field is built on: a label row with icon actions at its end, the control, then a status message and a helper line.

Status: beta. Group: form. Markdown version: /design-system/components/field-shell.md

When to use

The frame every text and choice field is built on: a label row with icon actions at its end, the control, then a status message and a helper line.

When not to use

  • Do not wrap a DS field (TextInput, TextArea, Select, Combobox, MultiCombobox, PhoneInput) in another FieldShell; they render their own.
  • Do not put text buttons or links in actions; actions are icon buttons that run an operation or open a menu of operations.
  • Do not use it for a group of controls; FormField's fieldset owns the group case.

Look-alikes

The contract names no look-alike with a deciding condition.

Props

FieldShell props
PropTypeDefaultDescriptionRequired
controlIdstringnoneId of the control inside; the label, status and helper ids derive from it.Yes
labelstringnoneVisible field label.Yes
childrenReact.ReactNodenoneThe control: an input, textarea, select or composite control.Yes
status"success" | "warning" | "error"noneSemantic state; pairs with statusMessage.No
statusMessagestringnoneMessage under the control, styled and announced for status.No
helperTextstringnoneSupporting copy under the control, after the status message.No
actionsFieldAction[]noneIcon buttons at the end of the label row, level with the label.No
requiredbooleanfalseShows the required marker on the label.No
disabledbooleanfalseDims the label and disables every action.No
hideLabelbooleanfalseVisually hides the label; it stays the control's accessible name.No
classNamestringnoneMerged onto the field wrapper.No

Variants

  • Allowed status values: success, warning, error.

Invalid combinations

The contract records no invalid combinations.

Keyboard

FieldShell keyboard behaviour
KeyBehaviour
GeneralLabel-row actions come before the control in Tab order, as they sit above it.
GeneralAn action with items opens a menu on Enter, Space or ArrowDown; arrow keys move through the items and Escape closes it.

Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

FieldShell rules
LevelRuleHow it is checked
MUSTARIA: The label is a <label for> the control and carries the id ${controlId}-label for controls named with aria-labelledby.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: The control's aria-describedby lists the status message and then the helper line (fieldDescribedBy builds it).Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: An error message is announced as an alert; aria-invalid is set by the control only for status error.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: Each action is an icon button named by its label, which is also its tooltip.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTRequired stories produce no axe violations at the configured severity.Automated by npm run test:stories:matrix:ci. WCAG 2.5.8.
MUSTThe accessibility tree (role, name, state) matches the committed snapshot for every required story.Automated by npm run test:stories:matrix:ci. WCAG 1.3.1, 4.1.2.
MUSTThe component remains legible and operable under a real browser forced-colors: active pass.Automated by npm run test:stories:hc.
MUSTEvery documented keyboard interaction works as specified.Not yet verified: no evidence record. WCAG 2.1.1, 2.1.2.
MUSTA human completed an end-to-end accessibility review of this component.Manual review, last on 2026-10-30.

Install and import

  • Install: npm install @digitaltableteur/react (version 0.9.1, restricted access on npm).
  • Import: import { FieldShell } from "@digitaltableteur/react";
  • Entry point: @digitaltableteur/react/forms exports it too.
  • Styles: import @digitaltableteur/react/style.css once at the app boundary.