import "capsomer/tokens.css";
import "capsomer/split.css";
import { Split } from "capsomer/react/split";
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
Prop
Type
Required
Does
heading
ReactNode
Yes
The block's heading and its id (the section is named by it).
headingId
string
Yes
level
"h2" | "h3" | "h4"
The heading's level on the page.
flip
boolean
The picture on the left. Set it from the block's own data, never its position.
media
ReactNode
Yes
The picture: an <img> or a <picture>, placed in the figure.
caption
ReactNode
A caption under the picture.
children
ReactNode
Yes
The text column: one element with className "cap-split-text" (a <p>, a <ul>, a <div>).
Parts and data attributes
Class
Is
.cap-split
the root
.cap-split-head
a part
.cap-split-media
a part
.cap-split-text
a part
Attribute
Values
data-flip
present or absent
data-list
names
Accessibility
Key
Does
Tab
Moves 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).