---
title: "Patterns"
description: "Multi-screen sequences a health product keeps rebuilding, each followed from entry to exit with its components, copy and failure cases"
url: "https://opsinjs.pensievelabs.org/docs/patterns"
source: "https://opsinjs.pensievelabs.org/docs/patterns.md"
section: "Patterns"
kind: "pattern"
aliases: ["pattern library", "user flows", "multi-screen sequences"]
---

A pattern is one user task followed across the screens it takes: the sequence, its states, the components it is built from and where the person can leave. A component page covers one part. A pattern covers the second screen, where the result arrives or validation fires. Patterns apply the rules in [Health](../health/index.mdx) rather than restating them.

## The patterns [#the-patterns]

| Pattern                                                    | Use it for                                                                                   |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [Result disclosure](./result-disclosure.mdx)               | Showing a result the reader may not want to see, from notification to number to next step    |
| [Daily logging](./daily-logging.mdx)                       | Repeated entry of the same reading, designed for the ninetieth entry rather than the first   |
| [Trend review](./trend-review.mdx)                         | Reading change over time without over-interpreting noise                                     |
| [Alert escalation](./alert-escalation.mdx)                 | Moving a message from ambient to interruptive only as far as it has earned                   |
| [Onboarding and first run](./onboarding-and-first-run.mdx) | Collecting the minimum before the reader has seen anything about them                        |
| [Consent and permissions](./consent-and-permissions.mdx)   | Asking for access when it is needed, and making withdrawal as easy as agreement              |
| [Empty and first use](./empty-and-first-use.mdx)           | The surface before there is anything to show, and which kind of nothing it is                |
| [Offline and stale data](./offline-and-stale-data.mdx)     | What a screen shows when it cannot vouch for its numbers                                     |
| [Sharing with a clinician](./sharing-with-a-clinician.mdx) | Exports and summaries a clinician can read in ninety seconds, with no interpretation implied |
| [Forms](./forms.mdx)                                       | How a question behaves: questions per page, when validation fires, where errors go           |
| [Ask users for…](./ask-users-for.mdx)                      | One kind of detail at a time, such as a name, a date of birth or a list of medicines         |

## The joins between screens [#the-joins-between-screens]

Every screen can pass its own audit while the journey fails, because the failures live in the joins.

* **Focus across a transition.** When a step replaces the last one, focus lands on the new heading.
* **Announcing change.** A value that updates in place is a status message (WCAG 2.2 SC 4.1.3).
* **Recovery.** Going back a step keeps what the person typed (WCAG 2.2 SC 3.3.7).
* **Leaving.** Every pattern states where the exit is.

## What is built [#what-is-built]

A pattern carries no `status`. Every component it names is shipped, which means it installs and renders. None has had an independent accessibility review or any clinical review, so nothing here is for a production health surface. A page whose sequence nobody has assembled carries a not-built marker. Three screen specimens render today: the results screen, the medicines app and the patient record portal. The daily log, trends, consent and onboarding screens are still specifications.

## Whole-app specimens [#whole-app-specimens]

[/showcase](/showcase) holds the whole screens opsinjs has built from its own components: the results screen above, the [diabetes medicines app](/showcase/diabetes-medicines-app) and the [patient record portal](/showcase/patient-record-portal). Each opens on its own at `/showcase/<slug>`, with nothing round it but a bar in the top right corner that leads back to the showcase and switches between light and dark and between phone, tablet and desktop sizes.

The medicines app has four destinations, five overlays and a working form built from thirty-five shipped components. It calculates no dose, changes no dose, never marks a dose as missed and stores nothing.

The portal is a patient's view of the record their hospitals write, built from twenty-four shipped components: five destinations, a share a doctor opens once, and an emergency card with no navigation on it. It shows what doctors wrote and explains none of it, changes nothing medical, keeps every control it cannot offer on screen with the reason beside it, and stores nothing. Its layout switches on the width of the app in rem, so a phone gets TabBar, a desktop window gets a sidebar and two columns, and 200% text gets the narrower layout it needs. Below 19rem the five destinations move into a menu sheet, because TabBar cannot fit them there ([#16](https://github.com/prashantonomy/opsinjs/issues/16)).

Neither composition has had a clinical safety review, so do not ship either to readers. Copy their refusals.
