Box
A convenient wrapper of React Native's View component. The props API matches the 'Flex' component in Reckon's Balance Design System.
Background
The background prop can be any of our background color tokens. Such as elevated
or sunken
. All possible options are listed in the props table below.
Flexbox shortcuts
Box includes special utility props for common flex-related style keys...
align
justify
flex
grow
(flexGrow)shrink
(flexShrink)basis
(flexBasis)orientation
(flexDirection)
Like in CSS, flex
is shorthand for flexGrow
flexShrink
and flexBasis
. Do not use flex
if any of the other props are defined.
Margin and Padding
This components mimics the Box component from our web design system for margin and padding. Margin and padding can be controlled in any direction, using shorthand utility props like padding
, for padding in all directions, paddingX
for horizontal padding, or paddingLeft
for padding left. Margin follows the same rules.
The valid tokens for these props come from 'spacing'.
Token | Value | x8 multiplier |
---|---|---|
"none" | 0 | 0x |
"xsmall" | 4 | 0.5x |
"small" | 8 | 1x |
"medium" | 12 | 1.5x |
"large" | 16 | 2x |
"xlarge" | 24 | 3x |
"xxlarge" | 32 | 4x |
"xxxlarge" | 40 | 5x |
"6x" | 48 | 6x |
"7x" | 56 | 7x |
"8x" | 64 | 8x |
"9x" | 72 | 9x |
"10x" | 80 | 10x |
Radii (border radius)
Like margin and padding, radii is also done using utility props, and each direction can be adjusted independently.
Token | Value |
---|---|
none | 0 |
xsmall | 4 |
small | 6 |
medium | 8 |
large | 12 |
xlarge | 16 |
circle | 9999 |