Components
DisclaimerNote
The short standing note saying this is information, not medical advice. It is placed by rule, so it is always in the same place and never in the way.
Usage
pnpm dlx shadcn@latest add @opsinjs/disclaimer-note
The @opsinjs namespace is declared in your components.json. Everything it installs is code you then own. There is no runtime package to keep in step.
import { DisclaimerNote } from "@/components/ui/disclaimer-note"<DisclaimerNote placement="footer">
The product's own two sentences go here. opsinjs ships none of them.
</DisclaimerNote>Examples
disclaimer-note · base base · style base-lyraOpen under the product themeOne note, at the foot of the surface
Three rows and one placement="footer" note under all of them: not one per row, and
never above them.
disclaimer-note-once-at-the-foot-of-a-surface · base base · style base-lyraOpen under the product themeimport { Card } from "@/components/ui/card"
import { DisclaimerNote } from "@/components/ui/disclaimer-note"
const ROWS = [
"First example measurement",
"Second example measurement",
"Third example measurement",
]
export default function DisclaimerNoteOnceAtTheFootOfASurface() {
return (
<div className="w-full max-w-(--opsin-measure-comfortable,66ch)">
<Card>
<Card.Header
title={<h3>Example surface</h3>}
description="Three things the reader came here to look at."
/>
<Card.Body>
<ul className="m-0 flex list-none flex-col gap-opsin-2 p-0">
{ROWS.map((row) => (
/* The last row gives up its bottom rule with `last:border-b-0`.
The note below closes the list with its own `border-t`, so
without this the last row's rule and the note's rule would be
two parallel hairlines about 18px apart with nothing between
them (the `mt-4` gap), which reads as a fourth row that failed
to load; any product copying this example would ship the same
stray rule. The surface is then left with exactly three
rules: two between the three rows and the note's own top edge. */
<li
key={row}
className="border-b border-border py-opsin-2 text-opsin-body last:border-b-0"
>
{row}
</li>
))}
</ul>
</Card.Body>
{/* A direct child of the card rather than a child of the body, because
it qualifies the whole surface and not the list. `mt-4` is the card's
own part rhythm written out: `Card.Header`, `Card.Body` and
`Card.Footer` carry `[&:not(:first-child)]:mt-4` from the card, and
anything else the card holds has to ask for it by hand.
IT IS `mt-4` AND NOT `mt-opsin-4`, WHICH ARE NOT THE SAME LENGTH.
Tailwind's step 4 is four multiples of `--spacing`, which the product
theme moves with `[data-density]`; `--opsin-space-4` is a fixed 1rem
that density does not touch. Written the second way the note's
separation from the list stays put while the card's own parts close
up or open out around it, which is the one thing this line is here to
avoid. */}
<DisclaimerNote placement="footer" className="mt-4">
Placeholder wording, for layout only. The product that ships this
surface writes the two sentences that belong here, and opsinjs ships
none of them.
</DisclaimerNote>
</Card>
</div>
)
}When nobody wrote the words
children of undefined, false, 0, an empty array or whitespace prints an admission
and warns in development. Copy in an element is taken at its word.
disclaimer-note-no-text-supplied · base base · style base-lyraOpen under the product themeimport { DisclaimerNote } from "@/components/ui/disclaimer-note"
export default function DisclaimerNoteNoTextSupplied() {
return (
<div className="w-full max-w-(--opsin-measure-comfortable,66ch)">
{/* No children, which is what `{wording.forThisLocale}` looks like on the
day the locale has no wording. A development warning names the same
thing in the console, so an author working on the screen finds it
before a reader does. */}
<DisclaimerNote />
</div>
)
}When to use it
Use it when
- Any surface that shows a health value, range, status or derived score to the person it belongs to.
- The end of a flow that gathered health information, where the reader may expect an assessment they will not get.
- Wherever a product could be mistaken for a clinical service, such as a symptom questionnaire or a result summary.
Do not use it when
- The reader needs to do something now, and the note would sit above the instruction.Use
care-cardinstead. - The message is specific to one result rather than a standing statement about the product.Use
calloutinstead. - Something has changed and needs the reader's attention.Use
alert-bannerinstead. - You are explaining a word rather than the product's limits.Use
terminstead. - The reader must acknowledge the statement before continuing, and the product needs a record of it.Use
consent-sheetinstead.
Clinical meaning
Asserts. That the product provides information rather than clinical assessment, does not replace a clinician's advice and, where relevant, is not a medical device. The component supplies position, type size, ink and boundary, and none of the content.
Never read as. A waiver or a substitute for designing safely, because a disclaimer does not make an unsafe screen safe and the safety review judges the screen. It is never this number is unreliable, since the note is about the product's role, not the measurement.
Colour axis. Neither. There is no status or category prop, no data-status or
data-category, and no fill (Two colour axes).
Thresholds. None. No clinical number is written into the component and none passes through it: no threshold, reference range, score band or staleness boundary.
Words. The consuming product's, under the rules in Health. opsinjs ships no legal text: no default string, no placeholder, no vetted variant and no translation fallback. Safety review sets out what DCB0129, DCB0160, the EU MDR and FDA SaMD ask of the product.
Accessibility
The rendered pass was clean, with zero axe violations, the link at its target floor,
focus-visible holding and nothing scrolling sideways at 320px or 200% text, and nothing in
the source needed changing. Type sizes and colours are role tokens, the decorative glyph
is aria-hidden, the statement is a real paragraph, and the only interactive element is
a real anchor that warns on unhelpful labels. Standing gates cover its one string on
every commit: no px type size, no raw colour literal, no banned word.
Residual items. The root is a plain <div> with no role and no accessible name, so
a screen reader meets the note as ordinary sentences rather than a bounded "note".
Reading order and content are fully conveyed, so this is not an AA failure. The boundary
is an enhancement left out on purpose, because a role is a spec decision reserved to
review and an aria-label would inject an English string into a translation-neutral
component.
| Key | Action | Notes |
|---|---|---|
| Tab | Moves to the link, when there is one | The note is text, not a tab stop. The link is the only focusable part. |
| Shift+Tab | Moves back out of the link | One stop, so reverse order matches visual order. |
| Enter | Follows the link | An ordinary anchor, so modifier-clicks keep the browser's behaviour. |
| Space | Scrolls the page, as it does anywhere else | Nothing here captures Space. |
Contrast: 36 measured token pairs, 15 below floor
| Pair | Theme | APCA Lc | WCAG 2.2 | Floor |
|---|---|---|---|---|
| body text on the page | light | 101.6 | 17.18:1 | Pass |
| body text on the page | dark | -100.5 | 18.00:1 | Pass |
| body text on a card | light | 104.7 | 17.96:1 | Pass |
| body text on a card | dark | -99.6 | 16.32:1 | Pass |
| body text on the muted ground | light | 98.1 | 16.32:1 | Pass |
| body text on the muted ground | dark | -97.5 | 13.77:1 | Pass |
| secondary text on the page | light | 83.9 | 7.42:1 | Pass |
| secondary text on the page | dark | -80.7 | 13.44:1 | Pass |
| secondary text on a card | light | 87.0 | 7.76:1 | Pass |
| secondary text on a card | dark | -79.8 | 12.19:1 | Pass |
| secondary text on the muted ground | light | 80.4 | 7.05:1 | Pass |
| secondary text on the muted ground | dark | -77.8 | 10.28:1 | Pass |
| a hairline boundary on the page | light | 19.3 | 1.41:1 | Below floor |
| a hairline boundary on the page | dark | -8.2 | 1.90:1 | Below floor |
| a hairline boundary on a card | light | 22.4 | 1.47:1 | Below floor |
| a hairline boundary on a card | dark | -7.3 | 1.72:1 | Below floor |
| a hairline boundary on the muted ground | light | 15.8 | 1.34:1 | Below floor |
| a hairline boundary on the muted ground | dark | 0.0 | 1.45:1 | Below floor |
| a placeholder boundary on the page | light | 69.8 | 4.52:1 | Pass |
| a placeholder boundary on the page | dark | -51.0 | 7.62:1 | Pass |
| a placeholder boundary on a card | light | 72.8 | 4.72:1 | Pass |
| a placeholder boundary on a card | dark | -50.1 | 6.91:1 | Pass |
| a placeholder boundary on the muted ground | light | 66.2 | 4.29:1 | Pass |
| a placeholder boundary on the muted ground | dark | -48.1 | 5.83:1 | Pass |
| a placeholder fill on the page | light | 8.3 | 1.18:1 | Below floor |
| a placeholder fill on the page | dark | -8.2 | 1.90:1 | Below floor |
| a placeholder fill on a card | light | 11.4 | 1.23:1 | Below floor |
| a placeholder fill on a card | dark | -7.3 | 1.72:1 | Below floor |
| a placeholder fill on the muted ground | light | 0.0 | 1.12:1 | Below floor |
| a placeholder fill on the muted ground | dark | 0.0 | 1.45:1 | Below floor |
| a placeholder boundary on its own fill | light | 58.9 | 3.84:1 | Pass |
| a placeholder boundary on its own fill | dark | -41.5 | 4.01:1 | Below floor |
| the card hairline on the page | light | 69.8 | 4.52:1 | Pass |
| the card hairline on the page | dark | -28.7 | 4.19:1 | Below floor |
| the card hairline on a card | light | 72.8 | 4.72:1 | Pass |
| the card hairline on a card | dark | -27.9 | 3.80:1 | Below floor |
These are the measured token pairs this component draws colour from, not a measurement of the component itself.
Props interface
Prop
Type
Generated from DisclaimerNoteProps in registry/bases/base/disclaimer-note.tsx.
children is typed optional and required by the contract, so the missing state can
render and print its admission. placement changes only the space above the note, and
there is no top value: never above the result. There is no default text and no
colour prop, and an axis class through className raises a development warning.