Skip to content
Content Blocks docsv0.8.0Website

Docs / Blocks

<content-split-block>

Two columns side by side, such as an image next to text, that stack on smaller screens.

Import it on its own, for a bundler
import '@content-blocks/js/components/content-split-block';

Examples

Image and text

One column on phones, two from 768px, with the text centred against the image.

Open on its own
The gate holds She has kept the north gate for nine winters, and will hold it one more.

Looping video

A muted .mp4 loops in one column. reverse="false|true" puts it on the right from 768px.

Open on its own
Forged in fire The broken blade, made whole.

Film in an overlay

The link opens a video in a content-overlay, and fill="#ex-split-film" makes it cover the whole split.

Open on its own
The armour waits ▶ Watch the omen

Anatomy

Content goes into the component's slots, chosen with the slot attribute on each child.

flowchart LR
  root["#lt;content-split-block#gt;"]:::component
  root --> s0["<b>slot=#quot;column1#quot;</b><br/>This will be column 1."]
  root --> s1["<b>slot=#quot;column2#quot;</b><br/>This will be column 2."]
  classDef component fill:#141413,color:#faf9f5,stroke:#141413
The slots of <content-split-block>
SlotWhat goes in it
slot="column1"This will be column 1.
slot="column2"This will be column 2.

Properties

Set them as attributes. Those marked responsive take a value per breakpoint, separated by pipes and named or in order: 1|tablet=2 or 1|2. Seeresponsive values.

AttributeTypeDefaultDescription
classesresponsiveString–Classes to add to the component. Use pipes for different classes per breakpoint, by name or in order: classes="stacked|laptop=side-by-side".
columnsresponsiveNumber'1|2'Not documented yet
paddingresponsiveString–Padding around the component, written as CSS padding. Use pipes for different padding per breakpoint, by name or in order: padding="1rem|tablet=2rem 4rem" or padding="1rem|2rem 4rem|3rem 5rem 4rem".
reverseresponsiveBooleanfalseNot documented yet
flowchart LR
  v["columns=#quot;1|2#quot;"]:::value
  v --> b0["mobile, from 0px: 1"]
  v --> b1["tablet and up, from 768px: 2"]
  classDef value fill:#1d4ed8,color:#fff,stroke:#1d4ed8
How columns="1|2" from the examples applies at each breakpoint