Grid

A 24-column responsive grid system based on flexbox for building page layouts.

When to Use

  • To create multi-column layouts with flexible widths
  • For responsive designs that adapt to different screen sizes
  • To align content with consistent gutters and offsets

Import

import { Row, Col } from "orizon";

Examples

Basic Grid

Columns span across a 24-column grid.

col-12
col-12
col-8
col-8
col-8
col-6
col-6
col-6
col-6
<Row>
  <Col span={12}>col-12</Col>
  <Col span={12}>col-12</Col>
</Row>
<Row>
  <Col span={8}>col-8</Col>
  <Col span={8}>col-8</Col>
  <Col span={8}>col-8</Col>
</Row>
<Row>
  <Col span={6}>col-6</Col>
  <Col span={6}>col-6</Col>
  <Col span={6}>col-6</Col>
  <Col span={6}>col-6</Col>
</Row>

Gutter Spacing

Set horizontal and vertical gutter between columns.

col-6
col-6
col-6
col-6
<Row gutter={[16, 16]}>
  <Col span={6}>col-6</Col>
  <Col span={6}>col-6</Col>
  <Col span={6}>col-6</Col>
  <Col span={6}>col-6</Col>
</Row>

Offset

Move columns to the right using offset.

col-8
col-8 offset-8
<Row>
  <Col span={8}>col-8</Col>
  <Col span={8} offset={8}>col-8 offset-8</Col>
</Row>

Flex Alignment

Use justify and align props on Row for alignment.

col-4
col-4
col-4
col-4
col-4
col-4
<Row justify="center">
  <Col span={4}>col-4</Col>
  <Col span={4}>col-4</Col>
  <Col span={4}>col-4</Col>
</Row>
<Row justify="space-between">
  <Col span={4}>col-4</Col>
  <Col span={4}>col-4</Col>
  <Col span={4}>col-4</Col>
</Row>

Responsive Columns

Columns adapt to different breakpoints using responsive props.

Responsive
Responsive
Responsive
Responsive
<Row gutter={[8, 8]}>
  <Col xs={24} sm={12} md={8} lg={6}>Responsive</Col>
  <Col xs={24} sm={12} md={8} lg={6}>Responsive</Col>
  <Col xs={24} sm={12} md={8} lg={6}>Responsive</Col>
  <Col xs={24} sm={12} md={8} lg={6}>Responsive</Col>
</Row>

API

Row Props

  • gutternumber | [number, number] | ResponsiveObject — Horizontal (or [horizontal, vertical]) spacing between columns (default: 0)
  • align"top" | "middle" | "bottom" | "stretch" — Vertical alignment of columns (default: "top")
  • justify"start" | "end" | "center" | "space-around" | "space-between" | "space-evenly" — Horizontal distribution (default: "start")
  • wrapboolean — Whether columns wrap to next line (default: true)
  • classNamestring — Custom CSS class
  • styleCSSProperties — Inline styles

Col Props

  • spannumber — Number of cells to occupy (0-24)
  • offsetnumber — Number of cells to skip from the left
  • pushnumber — Number of cells to push right
  • pullnumber — Number of cells to pull left
  • ordernumber — Flex order
  • flexstring | number — Flex grow/shrink/basis shorthand
  • xsnumber | object — Screen < 576px
  • smnumber | object — Screen >= 576px
  • mdnumber | object — Screen >= 768px
  • lgnumber | object — Screen >= 992px
  • xlnumber | object — Screen >= 1200px
  • xxlnumber | object — Screen >= 1600px