Column
A column is one or more vertical blocks of content positioned on a page, separated by gutters.
Columns are incredibly flexible. There are 12 template columns available per row, allowing you to create different combinations of elements that span any number of columns. Column widths are set in percentages so you always have the same relative sizing.
When building grid layouts, all content goes in columns. The hierarchy of grid goes from container to row to column to your content.
To set your column settings you can use one of the following methods:
- Pass value as
GridNumbers
: This value will be used as the columns width. TheGridNumbers
are:type GridNumbers =| 1 | 2 | 3 | 4 | 5 | 6| 7 | 8 | 9 | 10 | 11 | 12; - Pass value as an
object
with the following interface:interface IColumnObject {size?: GridNumbers;order?: GridNumbers;offset?: GridNumbers;}
Auto-width Columns
If you don't provide any width property, we will set the widths automatically using the flex-grow
(they will end up having an equal width).
Columns With Different Widths
Column Wrapping
If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.
Column Reordering
Column Offsetting
API
Learn more about the properties and the customization points.
Usage
import Column from "@sonnat/ui/Column";//orimport { Column } from "@sonnat/ui";
Properties
Note that the documentation avoids mentioning all the native props (there are a lot) in this section of the components.
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the column. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
all | number | object | - | Defines the number of grids the component is going to use. It's applied for the all breakpoints if not overridden. |
xxs | number | object | - | Defines the number of grids the component is going to use. It's applied for the xxs breakpoints if not overridden. |
xs | number | object | - | Defines the number of grids the component is going to use. It's applied for the xs breakpoints if not overridden. |
sm | number | object | - | Defines the number of grids the component is going to use. It's applied for the sm breakpoints if not overridden. |
md | number | object | - | Defines the number of grids the component is going to use. It's applied for the md breakpoints if not overridden. |
lg | number | object | - | Defines the number of grids the component is going to use. It's applied for the lg breakpoints if not overridden. |
xlg | number | object | - | Defines the number of grids the component is going to use. It's applied for the xlg breakpoints if not overridden. |
|