Layout primitives

Grid

Arranges content in columns with configurable gaps.

tsx
import Grid from '@precursor/grid';

Example

Two columns
One column
Full width
tsx
import Grid, { Row, Column } from '@precursor/grid';
import Panel from '@precursor/panel';
export default function Example() {
    return (
        <Grid columns={3} gap="s">
            <Row>
                <Column span={2}>
                    <Panel>Two columns</Panel>
                </Column>
                <Column>
                    <Panel>One column</Panel>
                </Column>
            </Row>
            <Row>
                <Column span={3}>
                    <Panel>Full width</Panel>
                </Column>
            </Row>
        </Grid>
    );
}

Props

Grid props
PropTypeDefaultNotes
childrenRequiredReactNode——
gap"xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl"'m'—
columnsnumber12—
columnGap"xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl"——
rowGap"xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl"——