Grid

A flexible 12-column grid with responsive breakpoint options.

Published Last updated: 5.8.0 Change log Github NPM
Twig Usage
{% include '@bolt-components-grid/grid.twig' with {
  gutter: 'medium',
  row_gutter: 'medium',
  items: [
    {
      column_start: '1',
      column_span: '1',
      row_start: '1',
      row_span: '1',
      valign: 'start',
      content: 'Item Content',
    },
  ]
} only %}
Schema
Note: when assigning component props as HTML attributes on a web component, make sure to use kebab-case.
Grid (grid.twig)
Prop Name Description Type Default Value Option(s)
attributes

A Drupal-style attributes object with extra attributes to append to this component.

object
gutter

Spacing between the columns of the grid.

string medium
  • none, small, medium, large
row_gutter

Spacing between the rows of the grid.

string medium
  • none, small, medium, large
items

Array of grid items to render inside the grid.

array
    • attributes

      A Drupal-style attributes object with extra attributes to append to this component.

    • content

      Content to render inside each grid item.

    • valign

      Vertical alignment of the grid item itself.

      • start, center, end
    • column_start

      The vertical starting point of the grid item. This accepts any number from 1 to 12, and their perspective responsive variations for advanced usage, for example, 6@small means the column start is set at 6 for any browser width larger and equal to the small breakpoint. This prop is required to make the grid work in Internet Explorer.

    • column_span

      The number of columns the grid item should span across. This accepts any number from 1 to 12, and their perspective responsive variations for advanced usage, for example, 6@small means the column span is set at 6 for any browser width larger and equal to the small breakpoint.

    • row_start

      The horizontal starting point of the grid item. This prop is required to make the grid work in Internet Explorer.

    • row_span

      The number of rows the grid item should span across.

Grid Item (grid-item.twig)
Prop Name Description Type Default Value Option(s)
attributes

A Drupal-style attributes object with extra attributes to append to this component.

object
valign

Vertical alignment of the grid item itself

string auto
  • auto, start, center, end
column_start

The general column the grid item should start on. For example, a with the attributes columns="3" start-column="2" would start on the 2nd column and extend for 3 columns so it would span the 2nd, 3rd and 4th column.

string
column_end

The general column the grid item should stop on. For example, a with the attributes start-column="2" end-column="3" would start on the 2nd column and extend until the 3rd column.

string
column_span

The number of columns the should span across

string
row_start

Specifies a grid item’s start position within the grid row

string auto
row_end

Specifies a grid item’s ending position within the grid row

string auto
row_span

Specifies the number of rows a should span across

string auto
Install Install
npm install @bolt/components-grid
Dependencies @bolt/core-v3.x