import Grid from '@precursor/grid';Example
Two columns
One column
Full width
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
| Prop | Type | Default | Notes |
|---|---|---|---|
childrenRequired | ReactNode | — | — |
gap | "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl" | 'm' | — |
columns | number | 12 | — |
columnGap | "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl" | — | — |
rowGap | "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl" | "xxxl" | — | — |