FormLayout
Grid-based layout wrapper for arranging form fields in single or multi-column configurations.
Examples
Vertical Stack
Fields stacked vertically. The default form layout.
Horizontal (Label Beside Input)
Labels aligned to the left of inputs for compact vertical space.
Grid (2-Column)
Two-column grid layout for denser forms.
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 { FormLayout } from "@rokle/components";import { FormLayout } from "@rokle/components";
export function Example() {
return <FormLayout />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| columns | 1 | 2 | 3 | 1 | Number of columns in the field grid. |
| gap | "sm" | "md" | "lg" | "md" | Spacing between fields. |
| children | ReactNode | - | Field components. |