The line at the top of a page that only its author can see yet, in a dashed box.
<article aria-labelledby="sample-page-title">
<p class="cap-draft-notice" id="sample-default"><span class="cap-draft-notice-tag">Draft<span class="cap-sr-only">:</span></span><span>Only you can see this page.</span></p>
<h3 id="sample-page-title">Spring update</h3>
<p>The first notes of the season, written up for Example Co.</p>
</article>
import "capsomer/tokens.css";
import "capsomer/draft-notice.css";
import { DraftNotice } from "capsomer/react/draft-notice";
Usage
<p class="cap-draft-notice">
<span class="cap-draft-notice-tag">Draft<span class="cap-sr-only">:</span></span>
<span>Only you can see this page.</span>
</p>
Examples
Other words, from React
<div data-mount="words"></div>
Not a draft: nothing drawn
<div data-mount="hidden"></div>
<p>A published page shows no notice.</p>
API reference
DraftNotice
Prop
Type
Required
Does
show
boolean
Draws nothing when false, so a page writes <DraftNotice show={draft} /> in place of a conditional.
label
string
The word in the box.
children
ReactNode
The sentence after it: who can see the page.
Parts and data attributes
Class
Is
.cap-draft-notice
the root
.cap-draft-notice-tag
a part
Accessibility
Key
Does
None
The notice is text
Read as one sentence, "Draft: Only you can see this page.": the colon after the word is visually hidden.
The word and the sentence are --text; the dashed edge is --warn at 3:1, and CanvasText in forced colors.