Skip to content
Playground

Field

Label, description, error, and control relationships for form fields.

Label, description, error, and control relationships for form fields.

Please choose an unique username

TSX
import { Field, Input } from "@zentara-co/zenos-ui";

Field provides the semantic relationship around a control. It owns the label, supporting description, error message, and inherited form state; the rendered control continues to own its value and input behavior.

The field stack uses body-small labels, 4px spacing between label, control, and helper text, and 11px helper or error copy matching the design-system field spec.

Field.Label supports optional required (inherits from Field.Root), optional for (Optional) copy, and tooltip with tooltipLabel for an accessible info trigger beside the label.

Set required, disabled, or invalid on Field.Root. Field.Control passes those semantics to its composed control and builds the appropriate aria-describedby relationship from the mounted description and error.

Required for incident and recovery notifications.

Managed by your organization.

Use an HTTPS endpoint.

Field.Control renders an input by default, so native attributes remain available when a separate styled input is unnecessary. Supply a stable id to Field.Root when another part of the application needs to reference the control.

This name is visible to other workspace members.

Field.Root
├── Field.Label
├── Field.Control
├── Field.Description
└── Field.Error
Field.Root
Field.Label
Field.Control
Field.Description
Field.Error

API

PropTypeDefaultDescription
Root.id string — Sets the control id and the base for generated supporting-text ids.
Root.invalid boolean false Connects error semantics to the control.
Root.required boolean false Marks and announces a required field.
Root.disabled boolean false Disables composed controls.
Control.render ReactElement | function — Field.Control composes with a native or Zenos control.
Control.children ReactElement — Shorthand for supplying a single composed control.
Label.required boolean — Shows a required asterisk. Inherits from Field.Root when omitted.
Label.optional boolean | string — Shows optional copy beside the label. true renders (Optional).
Label.tooltip ReactNode — Tooltip content for the info trigger beside the label.
Label.tooltipLabel string — Accessible name for the info trigger.
Label.htmlFor string — Overrides the generated label and control relationship.
Error.role AriaRole alert Controls how the error announcement is exposed.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

Field.Label targets the generated control id by default. Descriptions are announced with the control, while errors join that relationship only when the root is invalid. Field.Error uses role="alert" by default for newly surfaced errors. Keep labels visible and meaningful, and set invalid only after the application has determined that the current value is invalid.