Box

A convenient wrapper of React Native's View component. The props API matches the 'Flex' component in Reckon's Balance Design System.

Hello!

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.

Hello!
Hello!

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.

Hello!

The valid tokens for these props come from 'spacing'.

TokenValuex8 multiplier
"none"00x
"xsmall"40.5x
"small"81x
"medium"121.5x
"large"162x
"xlarge"243x
"xxlarge"324x
"xxxlarge"405x
"6x"486x
"7x"567x
"8x"648x
"9x"729x
"10x"8010x

Radii (border radius)

Like margin and padding, radii is also done using utility props, and each direction can be adjusted independently.

TokenValue
none0
xsmall4
small6
medium8
large12
xlarge16
circle9999
Hello!

All props

align
enum
background
"none" │ "default" │ "sunken" │ "elevated"
"none"
basis
number │ string
children
node
flex
number │ string
grow
number
height
number
justify
enum
margin
custom
marginBottom
custom
marginLeft
custom
marginRight
custom
marginTop
custom
marginX
custom
marginY
custom
orientation
"horizontal" │ "vertical"
"vertical"
padding
custom
paddingBottom
custom
paddingLeft
custom
paddingRight
custom
paddingTop
custom
paddingX
custom
paddingY
custom
rounding
enum
roundingBottom
enum
roundingLeft
enum
roundingRight
enum
roundingTop
enum
shrink
number
style
custom
width
number