Field
Composable form field wrapper combining a label, input, and validation message.
Examples
Basic with Label
A simple form field with label and input.
Required
Field marked as required with an asterisk indicator.
With Error
Field with inline validation error message.
With Description
Field with helper description text below the input.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { Field } from "@rokle/components";import { Field } from "@rokle/components";
export function Example() {
return <Field />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Field label text. |
| error | string | - | Validation error message. |
| required | boolean | false | Show required indicator on label. |
| children | ReactNode | - | The input element. |