Park UI

Field

A form wrapper for adding labels, help text, and error messages.

Installation

Usage

Examples

Invalid

Pass the invalid prop to Field.Root and use the Field.ErrorText to indicate that the field is invalid.

This is an error text

HelperText

Use the Field.HelperText to add helper text to the field.

This is a helper text

Required

Pass the required prop to Field.Root and use the Field.RequiredIndicator to indicate that the field is required.

Closed Component

Here's how to setup the field for a closed component composition.

Props

Root

PropDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

disabled
boolean

Indicates whether the field is disabled.

ids
ElementIds

The ids of the field parts.

invalid
boolean

Indicates whether the field is invalid.

readOnly
boolean

Indicates whether the field is read-only.

required
boolean

Indicates whether the field is required.

RequiredIndicator

PropDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

fallback
string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>

Textarea

PropDefaultType
autoresizefalse
boolean

Whether the textarea should autoresize

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.