nessra uinessra ui

Combine labels, controls, and help text to compose accessible form fields.

Loading...
import { Field, FieldDescription, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"

Installation

pnpmnpmyarnbun
pnpm dlx shadcn@latest add https://nessra-ui.vercel.app/r/field.json

Usage

import {
  Field,
  FieldDescription,
  FieldError,
  FieldLabel,
} from "@/components/ui/field"
<Field>
  <FieldLabel htmlFor="username">Username</FieldLabel>
  <Input id="username" />
  <FieldDescription>Your public display name.</FieldDescription>
</Field>

Examples

Horizontal Layout

Use orientation="horizontal" for inline layouts like checkboxes.

Loading...
import { Checkbox } from "@/components/ui/checkbox"
import {
  Field,

With Error

Add data-invalid="true" to Field and aria-invalid="true" to the input for error states.

Loading...
import {
  Field,
  FieldDescription,

API Reference

Field

PropTypeDefaultDescription
orientation"vertical" | "horizontal" | "responsive""vertical"Layout direction

FieldLabel

A styled label that automatically associates with form controls.

FieldDescription

Helper text displayed below the input.

FieldError

Error message container with accessible alert role.

FieldContent

Wrapper for grouping label and description in horizontal layouts.