Usage
The Container component can be used to build any sort of layout within the document body or other Page*
components.
::container
---
display: "block"
tag: "div"
color: "#000933"
border: "1px solid lightgray"
border-radius: "8px"
padding: "20px"
margin: "0px"
max-width: "100%"
text-align: "left"
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
::
Props
display
The display type of the component. Accepts the CSS values for 'display'.
- Type:
string
- Default:
'block'
::container
---
display: "flex"
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
::
alignItems
Sets the align-self value on all direct children as a group. In flexbox, it controls the alignment of items on the cross axis. In grid layout, it controls the alignment of items on the block axis within their grid areas. Accepts the native CSS allowed values for 'align-items'.
- Type:
string
Block 1
Block 2
::container
---
display: "flex"
align-items: "center"
---
:::container
Block 1
:::
:::container
Block 2
:::
::
justifyContent
Defines how the browser distributes space between and around content items along the main axis of a flex container and the inline axis of grid and multicol containers. Accepts the native CSS allowed values for justify-content
.
- Type:
string
Block 1
Block 2
::container
---
display: "flex"
justify-content: "end"
---
:::container
Block 1
:::
:::container
Block 2
:::
::
flex
The CSS shorthand property to set how a flex item will grow or shrink to fit the space available in its flex container.
- Type:
string
- Default:
null
First item
Second item
::container
---
display: "flex"
---
:::container
---
flex: "0 0 33%"
---
First item
:::
:::container
---
flex: "1 1 auto"
---
Second item
:::
::
flexDirection
When display
is set to 'flex'
, specifies the flex-direction of the flex container.
Accepts one of the following values: 'row' | 'row-reverse' | 'column' | 'column-reverse'
- Type:
string
- Default:
'row'
First item
Second item
::container
---
display: "flex"
flex-direction: "row"
---
:::container
First item
:::
:::container
Second item
:::
::
flexWrap
When display
is set to 'flex'
, specifies whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. Accepts the native CSS allowed values for flex-wrap.
- Type:
string
- Default:
'nowrap'
First item
Second item
Third item
::container
---
display: "flex"
flex-wrap: "nowrap"
---
:::container
First item
:::
:::container
Second item
:::
:::container
Third item
:::
::
gridColumns
When display
is set to 'grid'
, the minimum number of columns to display.
- Type:
number
- Default:
1
gridColumnsBreakpoints
When display
is set to 'grid'
, the grid-template-columns
for each pre-defined breakpoint.
- Type:
Breakpoints
- Default:
{}
/** Number of columns once the viewport width is greater than or equal to the breakpoint shown below. */ interface Breakpoints { /** 640px */ mobile?: number /** 768px */ phablet?: number /** 1024px */ tablet?: number /** 1280px */ laptop?: number /** 1536px */ desktop?: number }
Shared Props
This component also includes the shared props listed below:
backgroundColor
- default isnull
.backgroundImage
- default isnull
border
- default isnone
.borderRadius
- default is0px
.color
- default isnull
.gap
- default is20px
margin
- default is0px
.maxWidth
- default is100%
.padding
- default is0px
.tag
- default isdiv
.text-align
- default isnull
width
- default is100%
.styles
- default is''
.