Staffbase

Components

Field

Fields group form controls with labels, descriptions, and validation messages to provide clear context and accessibility.

Enter your full name.

Anatomy

Anatomy
import {Field, TextField} from '@staffbase/design';

<Field.Root>
  <Field.Label />
  <Field.Description />
  {/* Form control goes here */}
  <Field.Error />
</Field.Root>

Examples

Required label

Invalid state

Password must be at least 8 characters.

API reference

Root

Inherits props fromBase UI Field Root

Provides field context that links labels, descriptions, and error messages to form controls.

Name Type Description
children
ReactNode
The field content, usually a label, control, optional description, and optional error.

Label

Inherits props fromBase UI Field Label
Name Type Description
children
ReactNode
The visible label text for the associated control.
requiredLabel
string
Optional text rendered in parentheses after the label to indicate required input.

Description

Inherits props fromBase UI Field Description
Name Type Description
children
ReactNode
Supplementary helper text that is announced with the associated control.

Error

Inherits props fromBase UI Field Error

Displays an error message and prepends an alert icon.

Name Type Description
children
ReactNode
The error message content.