rokle

Personality

20
40
70
15

Active brand: Meridian

Adjust sliders to see every component on the page respond in real time.

Form

Accessible form container with integrated validation state management and submission handling.

Examples

Basic Contact Form

A simple contact form with name, email, and message.

With Validation Indicators

Form with inline validation states and error messages.

Horizontal Layout

Label and input side by side in a two-column layout.

Inline Form

Compact inline form on a single row.

Installation

pnpm add @rokle/components @rokle/tokens

Installs with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.

Usage

import { Form } from "@rokle/components";
import { Form } from "@rokle/components";

export function Example() {
  return <Form />;
}

API Reference

PropTypeDefaultDescription
onSubmit(values: Record<string, unknown>) => void-Called with form values on valid submission.
defaultValuesRecord<string, unknown>{}Initial field values.
childrenReactNode-Form field elements.