Skip to content

Split

A heading and a text column beside one picture, the sides flipping from block to block.

<section class="cap-split" id="split-right" aria-labelledby="y2026">
  <h3 class="cap-split-head" id="y2026">2026 cohort</h3>
  <ul class="cap-split-text" data-list="names">
    <li>Alex Rivera</li>
    <li>Sam Lee</li>
    <li>Jordan Park</li>
    <li>Casey Morgan</li>
    <li>Riley Chen</li>
    <li>Taylor Brooks</li>
  </ul>
  <figure class="cap-split-media">
    <img src="./specimen/split-img.svg" alt="Six people standing in front of a lab bench." width="800" height="600" />
  </figure>
</section>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/split.css";

Usage

<section class="cap-split" aria-labelledby="y2026">   <!-- data-flip puts the picture on the left -->
  <h3 class="cap-split-head" id="y2026">2026</h3>
  <ul class="cap-split-text" data-list="names"><li>Alex Rivera</li><li>Sam Lee</li></ul>
  <figure class="cap-split-media"><img src="..." alt="..." width="800" height="600" /></figure>
</section>

Examples

Picture on the left (data-flip), prose

<section class="cap-split" id="split-flip" data-flip aria-labelledby="y2025">
  <h3 class="cap-split-head" id="y2025">2025 cohort</h3>
  <p class="cap-split-text">Field notes from the spring update: the group sampled four sites and sequenced each isolate by the end of the term. <a href="#notes">Read the notes</a></p>
  <figure class="cap-split-media">
    <img src="./specimen/split-img.svg" alt="A sampling site by a creek." width="800" height="600" />
  </figure>
</section>

API reference

Split

PropTypeRequiredDoes
headingReactNodeYesThe block's heading and its id (the section is named by it).
headingIdstringYes
level"h2" | "h3" | "h4"The heading's level on the page.
flipbooleanThe picture on the left. Set it from the block's own data, never its position.
mediaReactNodeYesThe picture: an <img> or a <picture>, placed in the figure.
captionReactNodeA caption under the picture.
childrenReactNodeYesThe text column: one element with className "cap-split-text" (a <p>, a <ul>, a <div>).

Parts and data attributes

ClassIs
.cap-splitthe root
.cap-split-heada part
.cap-split-mediaa part
.cap-split-texta part
AttributeValues
data-flippresent or absent
data-listnames

Accessibility

KeyDoes
TabMoves through any links in the heading and text, in source order
  • The heading is a real heading at the page's level (h2 or h3).
  • The picture keeps its alt text; a decorative one has alt="".
  • Layout only: no order change for assistive technology (WCAG 1.3.2).