Field

Forms

Wires a label, description and error message to a control with the right ARIA relationships.

Live preview

Used for sign-in and receipts.

Installation

Import the component from the kit. The package ships source and is transpiled by Next.js.

Import
import { Field, Input } from "@nphuonha/ui-kit";

Usage

Compose the component with your own content. All controls share the same focus, disabled and invalid states.

Usage
<Field label="Password" error="Password is required">
<Input type="password" error />
</Field>

API Reference

Props are additive to the underlying Base UI or native element.

PropTypeDefaultDescription
labelReactNode—Visible label for the control.
descriptionReactNode—Helper text below the control.
errorReactNode—Error message; also marks the control invalid.
requiredboolean—Shows the required mark.
idstring—Explicit control id.