Field

Form field wrapper with label, description, error, and accessibility linking

import { Field } from "@plexui/ui/components/Field";

Examples

Overview

size
We'll never share your email with anyone else.

With description

We'll never share your email with anyone else.

With error message

Required

Sizing

size
We'll never share your email with anyone else.

Horizontal layout

orientation

Textarea

Write a short bio for your profile.

Select

Select your primary role.

Slider

Set your budget range ($200 – 800).

Fieldset

Address Information

We need your address to deliver your order.

Checkbox

Choose which notifications you'd like to receive.

Radio

Select your preferred plan.

Switch

Field group

Get notified when the assistant responds to requests that take time, like research or image generation.
Get notified when tasks you've created have updates.

Validation and Errors

Render prop pattern

For controls that need explicit prop wiring, pass a function as children. The function receives { id, "aria-describedby", "aria-invalid" } which you spread onto the control.

<Field label="Email" errorMessage="Email is required">
  {(fieldProps) => <Input {...fieldProps} placeholder="Enter email..." />}
</Field>

Optical alignment

opticallyAlign="start"
We'll never share your email.

Form example

Payment Method

All transactions are secure and encrypted


Billing Address

The billing address associated with your payment method

Profile settings

Personal Information

Your public profile details

This is the email associated with your account.
Brief description for your profile. Max 160 characters.

Preferences

Customize your experience

Select your preferred appearance.

Notifications

Manage how you receive updates

Receive weekly digests and important updates.
Get real-time alerts in your browser.
Tips, product updates, and promotions.

Create project

General

Basic information about your project

A short summary shown in project listings.
Controls who can see this project.

Team Access

Invite collaborators and set permissions

Add people by email address.
alice@team.com
bob@team.com
Default permissions for new members.

Infrastructure

Deployment and resource configuration

Automatically deploy on push to main branch.

Field configuration

Setup

Define the basic field properties

Unique identifier used in the API. Cannot be changed later.
Human-readable name displayed in the UI.
Value assigned when the field is empty.

Formatting

Input constraints and sanitization rules

Max length cannot exceed 4096.
Strip potentially unsafe HTML tags from input.

Privacy & Access

Control field visibility and mutability

Prevent this field from being redacted.
Value can only be set once and cannot be changed.
Automatically delete the field value after the specified period.

Birthday input

Birthday with validation

Birthday segmented input

/
/

Birthday with selects

Reference

PropTypeDefaultDescription
labelReactNodeLabel text for the field
descriptionReactNodeHelper text below the label; linked via aria-describedby
errorMessageReactNodeError message below the control; auto-sets aria-invalid on child
size"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl""md"Controls the label font size to match the child control
requiredbooleanfalseShows a required asterisk after the label (visual only)
orientation"vertical" | "horizontal""vertical"Layout direction of label and control
opticallyAlign"start" | "end"Applies optical alignment to the child control via negative margin using its gutter
idstringOverride the auto-generated id used for htmlFor/aria linking
childrenReactElement | (fieldProps) => ReactNodeForm control; receives id, aria-describedby, and aria-invalid