Oros UI

Search documentation

Search Oros UI pages and components.

Field

Connects labels, controls, descriptions, and validation messages.

Choose a unique username for your account.

We'll never share your email with anyone.

This field must be filled out.

This field is currently disabled.

This field contains validation errors.

This field is currently disabled.

Installation

Install Field from Oros with shadcn CLI 4.13.0.

pnpm dlx shadcn@4.13.0 add @oros/field

Usage

import {
  Field,
  FieldLabel,
  FieldDescription,
  FieldError,
  FieldGroup,
  FieldLegend,
} from "@/components/ui/field"

Open the Source tab in the preview for a complete working example.

Anatomy

ExportResponsibility
FieldThe root component that owns the primary structure and state.
FieldLabelProvides a visible label for its related control or value.
FieldDescriptionProvides supporting context for the current region.
FieldErrorA composable part of the component anatomy.
FieldGroupGroups related items into one logical set.
FieldLegendA composable part of the component anatomy.
FieldSeparatorVisually and semantically separates related groups.
FieldSetA composable part of the component anatomy.
FieldContentContains the primary visible content.
FieldTitleProvides the visible heading for the current region.

API Reference

Field exports 10 named entries. Component exports accept the props of their underlying HTML element or Base UI component, plus an optional className, unless the source defines a more focused type.

  • Field Component
  • FieldLabel Component
  • FieldDescription Component
  • FieldError Component
  • FieldGroup Component
  • FieldLegend Component
  • FieldSeparator Component
  • FieldSet Component
  • FieldContent Component
  • FieldTitle Component

Accessibility

  • Provide Field with a visible label or an equivalent programmatic accessible name.
  • Expose disabled, required, selected, and invalid states through the component API instead of color alone, and keep keyboard focus visible.

Source

Field uses the standard shadcn API and is distributed through Oros. Installing it adds the component source and required dependencies to your app. The Source tab above shows a complete usage example.

Migrating from COSS? Install field in place of fieldset.