Skip to content

Source line

A figure's source under it, a link that names the source and when it was read.

<div class="cap-specimen-row" id="sl-source">
  <div>
    <p><strong>9%</strong> of subscription payments fail on the first try.</p>
    <p class="cap-source-line"><a href="https://example.com/report" data-link="away" rel="external noopener noreferrer">Source: example.com, read October 2026<span class="cap-sr-only"> (opens another site)</span></a></p>
  </div>
</div>

Installation

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

Usage

import { SourceLine } from "capsomer/react/source-line";
import "capsomer/source-line.css";
<SourceLine href="https://example.com/report" read="October 2026" />

API reference

SourceLine

PropTypeRequiredDoes
hrefstringYes
readReactNodeYesWhen it was read: "October 2026".
nameReactNodeThe source's name. Default: the address's host.

Parts and data attributes

ClassIs
.cap-source-linethe root
StateRead from
:hoverthe platform

Accessibility

KeyDoes
Tab, EnterReaches and follows the link

The arrow is hidden; "(opens the source)" is read after the words.