Usage
Utilize the MultiColumn component to create a column layout to structure your custom content.
You can define a static number of columns to display at all viewport widths, or alternatively provide the number of columns for each breakpoint.
One
Two
Three
::multi-column
::container
One
::
::container
Two
::
::container
Three
::
::
Props
columns
The static number of columns to display.
- Type:
number
- Default:
undefined
When provided, the number of columns
provided will be applied to all viewport widths, unless overridden by the columnsBreakpoints
prop.
Resize your browser and notice that the component will always display the content in a two column grid.
One
Two
Three
::multi-column
---
columns: 2
---
::container
One
::
::container
Two
::
::container
Three
::
::
columnsBreakpoints
Used instead of, or alongside, the columns
prop, to define the number of columns to display for specific viewport widths.
Providing a column number for a given breakpoint will allow larger breakpoints to inherit the value if the number of columns is not explicitly defined for the larger 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 }
Resize your browser and notice how the column layout responds at different viewport widths.
One
Two
Three
Four
Five
Six
::multi-column
---
columns-breakpoints:
mobile: 2
phablet: 4
tablet: 2
laptop: 4
desktop: 3
---
::container
One
::
::container
Two
::
::container
Three
::
::container
Four
::
::container
Five
::
::container
Six
::
::
You can also define a static number of columns and override for just a single (or multiple) breakpoints.
In the example below, we set columns
to 3
, but override the laptop
and desktop
breakpoints to show a custom number of columns. Resize your browser to see the end result.
One
Two
Three
::multi-column
---
columns: 3
columns-breakpoints:
laptop: 4
desktop: 2
---
::container
One
::
::container
Two
::
::container
Three
::
::
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
horizontalAlign
- default isnull
margin
- default is0px
.maxWidth
- default is100%
.padding
- default is0px
.tag
- default isdiv
.text-align
- default isleft
verticalAlign
- default isnull
width
- default is100%
.styles
- default is''
.