Who wrote each passage of a text, marked by a patterned rule and a word, shown by one switch.
<div class="cap-authorship" data-cap="authorship" data-authorship="on" data-remember="off" id="au-on">
<div class="cap-authorship-bar"><label class="cap-switch" data-cap="switch"><input type="checkbox" role="switch" checked /> Show authorship <span class="cap-switch-state" aria-hidden="true">On</span></label><div class="cap-meter cap-authorship-summary" data-cap-part="summary"><span class="cap-meter-label">Authorship</span><span class="cap-meter-value" data-cap-part="text">35% you, 40% AI, 25% quoted by words</span><span class="cap-meter-bar" aria-hidden="true"><span class="cap-authorship-seg" data-kind="you" data-share="35"></span><span class="cap-authorship-seg" data-kind="ai" data-share="40"></span><span class="cap-authorship-seg" data-kind="quoted" data-share="25"></span></span><span class="cap-meter-note" data-cap-part="notes"><span>You: 37 words</span><span>AI: 42 words</span><span>Quoted: 26 words</span></span></div></div>
<div class="cap-authorship-text">
<div class="cap-run" data-kind="you"><span class="cap-run-label">You</span><p>I wrote the queue first and the rest second. Every mention arrives as a small note, and I read each one before it is shown.</p></div>
<div class="cap-run" data-kind="quoted"><span class="cap-run-label">Quoted</span><p>Every mention is untrusted until a person has looked at it. A link from a site nobody knows proves nothing about the page that sent it.</p></div>
<p><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>I ask the agent for a suggested order, </span><span class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span>and it explains each suggestion in one line. A suggestion is a note beside the mention, never a decision. </span><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>The decision stays mine.</span></p>
<div class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span><p>The queue lists mentions newest first, shows the sender's address in full, and keeps every hidden mention so it can be restored later.</p></div>
</div>
</div>
<Authorship>
<Run kind="you" block><p>I wrote the queue first.</p></Run>
<p><Run kind="you">I asked the agent, </Run><Run kind="ai">and it explained each suggestion.</Run></p>
</Authorship>
Examples
Hidden: plain prose
<div class="cap-authorship" data-cap="authorship" data-authorship="off" data-remember="off" id="au-off">
<div class="cap-authorship-bar"><label class="cap-switch" data-cap="switch"><input type="checkbox" role="switch" /> Show authorship <span class="cap-switch-state" aria-hidden="true">Off</span></label><div class="cap-meter cap-authorship-summary" data-cap-part="summary"><span class="cap-meter-label">Authorship</span><span class="cap-meter-value" data-cap-part="text">35% you, 40% AI, 25% quoted by words</span><span class="cap-meter-bar" aria-hidden="true"><span class="cap-authorship-seg" data-kind="you" data-share="35"></span><span class="cap-authorship-seg" data-kind="ai" data-share="40"></span><span class="cap-authorship-seg" data-kind="quoted" data-share="25"></span></span><span class="cap-meter-note" data-cap-part="notes"><span>You: 37 words</span><span>AI: 42 words</span><span>Quoted: 26 words</span></span></div></div>
<div class="cap-authorship-text">
<div class="cap-run" data-kind="you"><span class="cap-run-label">You</span><p>I wrote the queue first and the rest second. Every mention arrives as a small note, and I read each one before it is shown.</p></div>
<div class="cap-run" data-kind="quoted"><span class="cap-run-label">Quoted</span><p>Every mention is untrusted until a person has looked at it. A link from a site nobody knows proves nothing about the page that sent it.</p></div>
<p><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>I ask the agent for a suggested order, </span><span class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span>and it explains each suggestion in one line. A suggestion is a note beside the mention, never a decision. </span><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>The decision stays mine.</span></p>
<div class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span><p>The queue lists mentions newest first, shows the sender's address in full, and keeps every hidden mention so it can be restored later.</p></div>
</div>
</div>
Labels with an avatar
<div class="cap-authorship" data-cap="authorship" data-authorship="on" data-remember="off" id="au-avatar">
<div class="cap-authorship-bar"><label class="cap-switch" data-cap="switch"><input type="checkbox" role="switch" checked /> Show authorship <span class="cap-switch-state" aria-hidden="true">On</span></label><div class="cap-meter cap-authorship-summary" data-cap-part="summary"><span class="cap-meter-label">Authorship</span><span class="cap-meter-value" data-cap-part="text">35% you, 40% AI, 25% quoted by words</span><span class="cap-meter-bar" aria-hidden="true"><span class="cap-authorship-seg" data-kind="you" data-share="35"></span><span class="cap-authorship-seg" data-kind="ai" data-share="40"></span><span class="cap-authorship-seg" data-kind="quoted" data-share="25"></span></span><span class="cap-meter-note" data-cap-part="notes"><span>You: 37 words</span><span>AI: 42 words</span><span>Quoted: 26 words</span></span></div></div>
<div class="cap-authorship-text">
<div class="cap-run" data-kind="you"><span class="cap-run-label"><span class="cap-avatar" data-size="sm" aria-hidden="true"><span class="cap-avatar-fallback" aria-hidden="true">DE</span></span>You</span><p>I wrote the queue first and the rest second. Every mention arrives as a small note, and I read each one before it is shown.</p></div>
<div class="cap-run" data-kind="quoted"><span class="cap-run-label">Quoted</span><p>Every mention is untrusted until a person has looked at it. A link from a site nobody knows proves nothing about the page that sent it.</p></div>
<p><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>I ask the agent for a suggested order, </span><span class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span>and it explains each suggestion in one line. A suggestion is a note beside the mention, never a decision. </span><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>The decision stays mine.</span></p>
<div class="cap-run" data-kind="ai"><span class="cap-run-label"><span class="cap-avatar" data-kind="ai" data-size="sm" aria-hidden="true"><span class="cap-avatar-fallback" aria-hidden="true">AI</span></span>AI</span><p>The queue lists mentions newest first, shows the sender's address in full, and keeps every hidden mention so it can be restored later.</p></div>
</div>
</div>
Remembered choice
<div class="cap-authorship" data-cap="authorship" data-authorship="on" id="au-remember">
<div class="cap-authorship-bar"><label class="cap-switch" data-cap="switch"><input type="checkbox" role="switch" checked /> Show authorship <span class="cap-switch-state" aria-hidden="true">On</span></label><div class="cap-meter cap-authorship-summary" data-cap-part="summary"><span class="cap-meter-label">Authorship</span><span class="cap-meter-value" data-cap-part="text">35% you, 40% AI, 25% quoted by words</span><span class="cap-meter-bar" aria-hidden="true"><span class="cap-authorship-seg" data-kind="you" data-share="35"></span><span class="cap-authorship-seg" data-kind="ai" data-share="40"></span><span class="cap-authorship-seg" data-kind="quoted" data-share="25"></span></span><span class="cap-meter-note" data-cap-part="notes"><span>You: 37 words</span><span>AI: 42 words</span><span>Quoted: 26 words</span></span></div></div>
<div class="cap-authorship-text">
<div class="cap-run" data-kind="you"><span class="cap-run-label">You</span><p>I wrote the queue first and the rest second. Every mention arrives as a small note, and I read each one before it is shown.</p></div>
<div class="cap-run" data-kind="quoted"><span class="cap-run-label">Quoted</span><p>Every mention is untrusted until a person has looked at it. A link from a site nobody knows proves nothing about the page that sent it.</p></div>
<p><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>I ask the agent for a suggested order, </span><span class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span>and it explains each suggestion in one line. A suggestion is a note beside the mention, never a decision. </span><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>The decision stays mine.</span></p>
<div class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span><p>The queue lists mentions newest first, shows the sender's address in full, and keeps every hidden mention so it can be restored later.</p></div>
</div>
</div>
Comfortable density
<div data-density="comfortable"><div class="cap-authorship" data-cap="authorship" data-authorship="on" data-remember="off" id="au-comfortable">
<div class="cap-authorship-bar"><label class="cap-switch" data-cap="switch"><input type="checkbox" role="switch" checked /> Show authorship <span class="cap-switch-state" aria-hidden="true">On</span></label><div class="cap-meter cap-authorship-summary" data-cap-part="summary"><span class="cap-meter-label">Authorship</span><span class="cap-meter-value" data-cap-part="text">35% you, 40% AI, 25% quoted by words</span><span class="cap-meter-bar" aria-hidden="true"><span class="cap-authorship-seg" data-kind="you" data-share="35"></span><span class="cap-authorship-seg" data-kind="ai" data-share="40"></span><span class="cap-authorship-seg" data-kind="quoted" data-share="25"></span></span><span class="cap-meter-note" data-cap-part="notes"><span>You: 37 words</span><span>AI: 42 words</span><span>Quoted: 26 words</span></span></div></div>
<div class="cap-authorship-text">
<div class="cap-run" data-kind="you"><span class="cap-run-label">You</span><p>I wrote the queue first and the rest second. Every mention arrives as a small note, and I read each one before it is shown.</p></div>
<div class="cap-run" data-kind="quoted"><span class="cap-run-label">Quoted</span><p>Every mention is untrusted until a person has looked at it. A link from a site nobody knows proves nothing about the page that sent it.</p></div>
<p><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>I ask the agent for a suggested order, </span><span class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span>and it explains each suggestion in one line. A suggestion is a note beside the mention, never a decision. </span><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>The decision stays mine.</span></p>
<div class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span><p>The queue lists mentions newest first, shows the sender's address in full, and keeps every hidden mention so it can be restored later.</p></div>
</div>
</div></div>
React: Authorship and Run
<div data-mount="react"></div>
Narrow container, labels above
<main class="specimen-page">
<h1>Narrow</h1>
<div class="cap-authorship" data-cap="authorship" data-authorship="on" data-remember="off" id="au-narrow">
<div class="cap-authorship-bar"><label class="cap-switch" data-cap="switch"><input type="checkbox" role="switch" checked /> Show authorship <span class="cap-switch-state" aria-hidden="true">On</span></label><div class="cap-meter cap-authorship-summary" data-cap-part="summary"><span class="cap-meter-label">Authorship</span><span class="cap-meter-value" data-cap-part="text">35% you, 40% AI, 25% quoted by words</span><span class="cap-meter-bar" aria-hidden="true"><span class="cap-authorship-seg" data-kind="you" data-share="35"></span><span class="cap-authorship-seg" data-kind="ai" data-share="40"></span><span class="cap-authorship-seg" data-kind="quoted" data-share="25"></span></span><span class="cap-meter-note" data-cap-part="notes"><span>You: 37 words</span><span>AI: 42 words</span><span>Quoted: 26 words</span></span></div></div>
<div class="cap-authorship-text">
<div class="cap-run" data-kind="you"><span class="cap-run-label">You</span><p>I wrote the queue first and the rest second. Every mention arrives as a small note, and I read each one before it is shown.</p></div>
<div class="cap-run" data-kind="quoted"><span class="cap-run-label">Quoted</span><p>Every mention is untrusted until a person has looked at it. A link from a site nobody knows proves nothing about the page that sent it.</p></div>
<p><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>I ask the agent for a suggested order, </span><span class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span>and it explains each suggestion in one line. A suggestion is a note beside the mention, never a decision. </span><span class="cap-run" data-kind="you"><span class="cap-run-label">You</span>The decision stays mine.</span></p>
<div class="cap-run" data-kind="ai"><span class="cap-run-label">AI</span><p>The queue lists mentions newest first, shows the sender's address in full, and keeps every hidden mention so it can be restored later.</p></div>
</div>
</div>
</main>
API reference
Run
Prop
Type
Required
Does
kind
Kind
Yes
block
boolean
A block (a div around paragraphs) rather than a span inside one.
badge
ReactNode
Something small before the word on the label: an Avatar with aria-hidden, for example.
children
ReactNode
Authorship
Prop
Type
Required
Does
shown
boolean
Controlled; leave both out and the component remembers the person's choice.
onShownChange
(shown: boolean) => void
defaultShown
boolean
Shown unless the person chose otherwise. Default true.
remember
boolean
Keep the choice in localStorage (the uncontrolled default).
children
ReactNode
Yes
The runs, as <Run>s inside your paragraphs.
Functions
Function
Signature
Does
summarize
(runs: readonly RunInput[]): Summary
Word counts per kind, as percentages that add up to 100, and the sentence that says them.
summaryText
(shares: Share[]): string
summaryHtml
(summary: Summary, label?: string): string
The summary as html, for a server to write: the line, the bar (drawn by enhance, which sets each segment's width), and the word counts in text.
collectRuns
(root: Element): RunInput[]
Every run's words, counted once: text inside a run belongs to the nearest run around it, a label never counts, and text outside any run is not marked so it is left out.
refresh
(root: Element): Summary
Counts the runs inside root and rewrites its summary (the line, the word counts, the bar).
Shows or hides the marks: data-authorship on the container, the switch to match. With persist (the default, unless the container says data-remember="off") the choice is kept.
enhance
(root?: ParentNode): () => void
Attaches to every [data-cap="authorship"] under root (or root itself) not yet attached: applies the remembered choice, wires the switch, and counts the summary. Returns a function that detaches them all.
CSS variables
Variable
Default
--cap-auth-gutter
5.5rem
--cap-auth-pad
var(--space-3)
--cap-auth-pad-block
var(--space-4)
--cap-auth-rule
4px
--cap-avatar-size
var(--title-6)
--cap-run-color
var(--accent)
--cap-run-pattern
solid
--cap-share
0
Parts and data attributes
Class
Is
.cap-authorship
the root
.cap-authorship-bar
a part
.cap-authorship-seg
a part
.cap-authorship-summary
a part
.cap-authorship-text
a part
.cap-run
its own class
.cap-run-label
its own class
Attribute
Values
data-authorship
off
data-kind
aiquoted
data-share
0
State
Read from
:checked
the platform
Accessibility
Key
Does
Tab
Moves to the switch; the runs, labels and summary take no tab stop
Space on the switch
Shows or hides the authorship marks, at once
A label is text in the run, read where the run starts ("You", "AI", "Quoted"). Hidden, labels are not in the accessibility tree.
The rules are decoration for a screen reader and the identifying mark for a sighted person: 3:1 on the page, with a pattern.
The summary's bar is aria-hidden; its numbers are text. Label text, the summary and the notes reach 4.5:1.
An avatar in a label is aria-hidden, so the kind is not said twice.
Forced colors: the rules and bar segments are drawn in CanvasText, keeping their patterns; labels get a border.
Screen readers: no manual NVDA or VoiceOver run, by decision (2026-11-07); the automated browser checks and a front-end review stand in. Automated: see the site's Tests page.