Skip to content
opsinjs
Edit this page

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

Theme
Density
Text
Status
Accent theme
Accent
disclaimer-note · base base · style base-lyraOpen under the product theme

One 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.

Theme
Density
Text
Status
Accent theme
Accent
disclaimer-note-once-at-the-foot-of-a-surface · base base · style base-lyraOpen under the product theme
disclaimer-note-once-at-the-foot-of-a-surface.tsx
import { 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.

Theme
Density
Text
Status
Accent theme
Accent
disclaimer-note-no-text-supplied · base base · style base-lyraOpen under the product theme
disclaimer-note-no-text-supplied.tsx
import { 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-card instead.
  • The message is specific to one result rather than a standing statement about the product.Use callout instead.
  • Something has changed and needs the reader's attention.Use alert-banner instead.
  • You are explaining a word rather than the product's limits.Use term instead.
  • The reader must acknowledge the statement before continuing, and the product needs a record of it.Use consent-sheet instead.

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.

KeyActionNotes
TabMoves to the link, when there is oneThe note is text, not a tab stop. The link is the only focusable part.
Shift+TabMoves back out of the linkOne stop, so reverse order matches visual order.
EnterFollows the linkAn ordinary anchor, so modifier-clicks keep the browser's behaviour.
SpaceScrolls the page, as it does anywhere elseNothing here captures Space.
Contrast: 36 measured token pairs, 15 below floor
PairThemeAPCA LcWCAG 2.2Floor
body text on the pagelight101.617.18:1Pass
body text on the pagedark-100.518.00:1Pass
body text on a cardlight104.717.96:1Pass
body text on a carddark-99.616.32:1Pass
body text on the muted groundlight98.116.32:1Pass
body text on the muted grounddark-97.513.77:1Pass
secondary text on the pagelight83.97.42:1Pass
secondary text on the pagedark-80.713.44:1Pass
secondary text on a cardlight87.07.76:1Pass
secondary text on a carddark-79.812.19:1Pass
secondary text on the muted groundlight80.47.05:1Pass
secondary text on the muted grounddark-77.810.28:1Pass
a hairline boundary on the pagelight19.31.41:1Below floor
a hairline boundary on the pagedark-8.21.90:1Below floor
a hairline boundary on a cardlight22.41.47:1Below floor
a hairline boundary on a carddark-7.31.72:1Below floor
a hairline boundary on the muted groundlight15.81.34:1Below floor
a hairline boundary on the muted grounddark0.01.45:1Below floor
a placeholder boundary on the pagelight69.84.52:1Pass
a placeholder boundary on the pagedark-51.07.62:1Pass
a placeholder boundary on a cardlight72.84.72:1Pass
a placeholder boundary on a carddark-50.16.91:1Pass
a placeholder boundary on the muted groundlight66.24.29:1Pass
a placeholder boundary on the muted grounddark-48.15.83:1Pass
a placeholder fill on the pagelight8.31.18:1Below floor
a placeholder fill on the pagedark-8.21.90:1Below floor
a placeholder fill on a cardlight11.41.23:1Below floor
a placeholder fill on a carddark-7.31.72:1Below floor
a placeholder fill on the muted groundlight0.01.12:1Below floor
a placeholder fill on the muted grounddark0.01.45:1Below floor
a placeholder boundary on its own filllight58.93.84:1Pass
a placeholder boundary on its own filldark-41.54.01:1Below floor
the card hairline on the pagelight69.84.52:1Pass
the card hairline on the pagedark-28.74.19:1Below floor
the card hairline on a cardlight72.84.72:1Pass
the card hairline on a carddark-27.93.80:1Below 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.