Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

FormGrid

Open .md
Live preview

Loading example…

Grid for fields. One column in a narrow container, then up to columns by container width (the wrapper is the size container; the grid keeps className and props).

import { FormGrid } from "@jcsoftdev/ui/forms";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/forms/form-grid.

export const Default: Story = {
render: (args) => (
<FormGrid {...args}>
<Field label="Nombre">
<Input placeholder="Marco" />
</Field>
<Field label="Apellido">
<Input placeholder="Salazar" />
</Field>
<Field label="Teléfono">
<Input type="tel" placeholder="987 654 321" />
</Field>
<Field label="Barbero">
<Select>
<option>Diego Quispe</option>
<option>Luis Paredes</option>
</Select>
</Field>
</FormGrid>
),
};

Source of the Storybook story.

Prop Type Default Description
columns 2 | 1 | 3 2 Largest column count, reached by container width: 2 columns from 620px, 3 from 900px (the wrapper is the size container). 1 never splits. Default 2.

* marks a required prop.

It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).

packages/ui/src/forms/form-grid/form-grid.tsx