Unlock faster development with Fidely UI Pro components Coming soon

Field

Provides a flexible container for form inputs, labels, and helper text.

Usage

import { Field } from '@fidely-ui/react'
<Field.Root>
  <Field.Label>
    <Field.RequiredIndicator />
  </Field.Label>
  <Input />
  <Field.HelperText />
  <Field.ErrorText />
</Field.Root>

Examples

Error Text

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

This is an error text

Helper Text

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

This is a helper text

Disable

You can use the disabled prop to disable the field.

Textarea

This example illustrates how to use the Field component with a textarea element.

You can pass the autoresize prop to the Textarea component to enable automatic resizing as the user types.

Props

Root

PropDefaultTypeDescription
invalid-booleanIndicates whether the field is invalid..
ids-ElementIdsThe ids of the field parts.
readOnlybooleanIndicates whether the field is read-only.
requiredbooleanIndicates whether the field is required..
disabledbooleanIndicates whether the field is disabled.
asReact.ElementTypeThe underlying element to render.
asChildfalsebooleanUse the provided child element as the default rendered element, combining their props and behavior.

On this page