Column
Lays out children in a vertically $spaced layout (default spacing is 24px).
Since Column
follows the space principle you can compose / nest Column
s easily. The following example has three Column
s in a Column(Column(blue,pink),Column(blue,pink))
heirarchy but to the user it looks seemless (like a single Column(blue,pink,blue,pink)
). This ability to nest allows you to easily create and reuse components without having to worry about how they will get used.
Alignment
- By default
$vAlign:start
and$hAlign:stretch
. It helps you write simple vertical layouts that start vertically at the top and fill the horizontal $space completely:
$vAlign?: 'start' /** default */ | 'center' | 'end'
controls vertical alignment of children. e.g.$vAlign='end'
gives us:
$hAlign?: 'stretch' /** default */ | 'start' | 'center' | 'end'
Controls horizontal alignment of children. e.g.$hAlign='left'
gives us:
Only
You chose to have the component visible $only
on mobile
or desktop
(determined by $bp
).
If you chose to hide an item like this, the parent should have spacing of 0
otherwise there might be some empty space by the sibling.
Space
Column
supports the $space
prop as explained in the space principle.
Scale
Column
supports the $scale
prop as explained in the scale principle.
DivProps
Column
supports all DivProps
.
BaseProps
Column
supports all BaseProps
.