Box
- Provide spacing to child elements.
- Impose sizing constraints on content.
- Control layout behavior within flex and grid containers.
- Hide content based on screen size using its responsive
display
prop.
Flex
Grid
The Grid component is used to organize the content in columns and rows. Like Box and Flex, it’s made to provide convenient access to the underlying CSS grid properties without any magic of its own.Section
Container
max-width
to the content it wraps. Like Section, it comes just with a couple of pre-defined sizes that work well with common breakpoints and typical content widths for comfortable reading.
Card
- Preview
- Code
Tabs
- Preview
- Code
Tab Cards
- Preview
- Code
Common layout props
Each layout component has a set of it’s own specialized props and also a shared set of common layout props. All layout props support responsive object values.Padding
Padding props can access the space scale steps or accept any valid CSS padding value.Prop | Type | Default |
---|---|---|
p | Responsive<number | string> | No default value |
px | Responsive<number | string> | No default value |
py | Responsive<number | string> | No default value |
pt | Responsive<number | string> | No default value |
pr | Responsive<number | string> | No default value |
pb | Responsive<number | string> | No default value |
pl | Responsive<number | string> | No default value |
Width
Width props accept any valid CSS width value.Prop | Type | Default |
---|---|---|
width | Responsive<string> | No default value |
minWidth | Responsive<string> | No default value |
maxWidth | Responsive<string> | No default value |
Height
Height props accept any valid CSS height value.Prop | Type | Default |
---|---|---|
height | Responsive<string> | No default value |
minHeight | Responsive<string> | No default value |
maxHeight | Responsive<string> | No default value |
Positioning
Positioning props can change how the element is placed relative to the normal flow of the document. As usual, the corresponding CSS values are accepted for each property, and the space scale steps can be used for the offset values.Prop | Type | Default |
---|---|---|
position | Responsive<enum> | No default value |
inset | Responsive<enum | string> | No default value |
top | Responsive<enum | string> | No default value |
right | Responsive<enum | string> | No default value |
bottom | Responsive<enum | string> | No default value |
left | Responsive<enum | string> | No default value |
Flex children
Each layout component has props used to control the style when it is a child of a flex container.Prop | Type | Default |
---|---|---|
flexBasis | Responsive<string> | No default value |
flexShrink | Responsive<enum | string> | No default value |
flexGrow | Responsive<enum | string> | No default value |
Grid children
Each layout component has props used to control the style when it is a child of a grid container.Prop | Type | Default |
---|---|---|
gridArea | Responsive<string> | No default value |
gridColumn | Responsive<string> | No default value |
gridColumnStart | Responsive<string> | No default value |
gridColumnEnd | Responsive<string> | No default value |
gridRow | Responsive<string> | No default value |
gridRowStart | Responsive<string> | No default value |
gridRowEnd | Responsive<string> | No default value |
Margin props
Margin props are available on most components in order to provide spacing around the elements. They are not exclusive to layout components. Margin props can access the space scale steps or accept any valid CSS margin valueProp | Type | Default |
---|---|---|
m | Responsive<enum | string> | No default value |
mx | Responsive<enum | string> | No default value |
my | Responsive<enum | string> | No default value |
mt | Responsive<enum | string> | No default value |
mr | Responsive<enum | string> | No default value |
mb | Responsive<enum | string> | No default value |
ml | Responsive<enum | string> | No default value |