# Screen patterns

> Which screen shape fits each kind of use case, and the states every pattern must design.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://design.docs.sypnia.com/components/patterns/

For agents: Patterns in gallery.yaml patterns[] {id, for (kind of case), regions[], pieces[], phone, desktop, states_required[]}. Default set the guide starts from (renamed and shaped per brand): do-something (form to an outcome: place-order), review-a-list (list and detail: today's orders), see-one-thing (detail), find (search and filter), summary (numbers and what needs attention), settings, sign-in, first-time (empty and onboarding). Required states for every pattern: loading (skeleton in the shape of the result), empty, each outcome, each failure of the case, offline. The pattern a case uses is chosen in its screen file; a case whose kind fits no pattern triggers a proposal.

Most use cases are one of a few kinds: doing something, reviewing a list, looking at one thing, finding something. A **pattern** is the screen shape your guide uses for each kind, so similar cases feel the same.

## The patterns a guide starts with

| Pattern         | For cases that…                                   | La Espiga example        |
| --------------- | ------------------------------------------------- | ------------------------ |
| `do-something`  | take the person through a few steps to an outcome | «Order for today»        |
| `review-a-list` | show many items to act on, with a detail          | «Today's orders» (staff) |
| `see-one-thing` | show one item and its actions                     | «Order detail»           |
| `find`          | search and filter                                 | «Find a product»         |
| `summary`       | show numbers and what needs attention             | «How today went»         |
| `settings`      | change how something works                        | «Opening hours»          |
| `sign-in`       | identify a person                                 | «Sign in»                |
| `first-time`    | greet someone with nothing yet                    | «Your first order»       |

Each brand shapes and names its own; a guide may drop patterns it does not need and add others.

## What a pattern says

`design/gallery.yaml (patterns, part)`

```yaml
patterns:
  - id: do-something
    for: Cases that take the person to one outcome in a few steps.
    regions: [header, steps, content, action]
    pieces: [stepper, product-card, quantity, button]
    phone: The action sits at the bottom, always visible; one step per screen.
    desktop: Steps on the left, content in the middle, a summary with the action on the right.
    states_required: [loading, empty, outcome, failures, offline]
```

## States every pattern designs

| State      | What it shows                                              |
| ---------- | ---------------------------------------------------------- |
| `loading`  | a skeleton in the shape of what is coming, never a spinner |
| `empty`    | what to do when there is nothing yet                       |
| `outcome`  | each ending of the case («Reserved, here is your code»)    |
| `failures` | each failure of the case, with its message from Cases      |
| `offline`  | what still works without a connection, and what waits      |

A case whose kind fits no pattern makes the agent propose a new pattern for the guide, instead of inventing a one-off screen.
