Row
Lays out children in a horiztonally spaced layout (default spacing is 24px).
Since Row
follows the space principle you can compose / nest Row
s easily. The following example has two Row
s in a Row(Row(blue,pink),Row(blue,pink))
heirarchy but to the user it looks seemless (like a single Row(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
$hAlign:start
and$vAlign:stretch
. It helps you write simple horizontal layouts that start horizontally at left and fill the vertical space completely:
$vAlign?: 'stretch' /** default */ | 'start' | 'center' | 'end' | 'baseline'
controls vertical alignment of children. e.g.vAlign='start'
gives us:
$hAlign?: 'start' /** default */ | 'center' | 'end'
controls horizontal alignment of children. e.g.hAlign='end'
gives us:
$vAlign: 'baseline'
is really useful with mixed font sizes
Reverse
Row
takes $reverse?: boolean
that lays out its children in reverse order of how they appear in the dom.
Common use case: With bottom of the form previous ---- next
buttons, $reverse
allows you to have tab order be intutive while the layout being visually appealing (tabbing out of input takes you to "Next"):
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
.