Combine an input, label, icon, and validation feedback into a consistent form field.

How to use

Use Field to combine a label, input, help, and error. When Input, Select, or Textarea is placed inside Field, Field owns the related surfaces. Use as="segment" for adjoining field segments; avoid duplicate borders and error regions.

  • label and error provide default copy; invalid and readonly express field state.

  • Use children to compose Input, Select, Textarea, and attachments. parts configures generated label and error content; set Props directly on explicit child components.

Leading and trailing accessories are part of one field, not separate segments, and have no segment dividers. Validated date inputs remain on the same row as external accessories.

Import

import { Field } from '@snowui-design-system/components';

Usage

Card

Notifications

Permissions

Date

Company

Country

Status

Name

Budget

Phone

Email validation

Country validation

Tags

Message

Website

Model

API Reference

Property Type Default Example Description
invalid boolean false invalid Invalid state for the whole field, forcing an error border.
readonly boolean false readonly Read-only state for the whole field.
label string | Snippet — label={labelContent} Generate an internal <Text as="label">. No label is generated by default.
error string | Snippet — error={errorContent} Generate an internal <Text as="error"> when invalid=true. No error is generated by default.
parts ComponentPartsOf<{ Text: typeof Text }> — parts={partsOptions} Configure the generated label and error Text components.
children Snippet — <Field>Content</Field> Field content composed freely from inputs and related elements.
No data