Split Block
Split block is an Astro layout component that allows you to split content into two columns and serve whatever content you would like within each column. The split block component is responsive and can be used to create a variety of layouts.
API Reference
This component uses grid
to create responsive split layouts. The following are the props that can be passed to the component.
Prop | Type | Default |
---|---|---|
as | HTMLTag | div |
split | "1/4" | "1/3" | "1/2" | "2/3" | "3/4" | 1/2 |
reverse | boolean | false |
Examples
Splits
The split
prop can be used to define the ratio of the split. The value is a fraction of the total width of the block. Split Block comes with the following splits: 1/4
, 1/3
, 1/2
, 2/3
, and 3/4
. Splits should be added, removed, and modified as needed to create the desired layout.
Reverse
The reverse
prop can be used to reverse the order of the columns when columns are not stacked. This can be useful for alternating the layout of the columns.
Astro Component
It’s recommended that an element like this is made as a reusable component. In this case, we have put together the following Astro component to serve as a blueprint for how you could possibly set up a Split Block component, and what properties to consider.