Skip to content

FormGrid

Open .md
Live preview

Loading example…

Grid for pairs of fields. One column in a narrow container, two columns from 620px of 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.

This component declares no props of its own.

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