# Your gallery

> Which piece to use for what, how to combine them, and every piece shown live.

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

For agents: Gallery = design/gallery.yaml (source) + a page. gallery.yaml: pieces[] {id, component (path in src/design), for, not_for, variants[], states[], combines_with[], example}; combinations[] {id, pieces[], for, rule}; patterns[] (see Patterns). The page: design gallery serves http://localhost:4520 (engine); Cloud serves a private page at design.app.sypnia.com/<org>/<project>/gallery, team members only, share links expire (default 7 days); every piece live, light/dark, phone/desktop, every state, with for / not for and the screens that use it. The agent reads gallery.yaml before choosing a piece; a piece not in gallery.yaml cannot be used.

The gallery is the guide to your pieces: what each one is for, what it is **not** for, how pieces go together, and which screen pattern fits each kind of use case. It is a file your agent reads and a page people look at.

## The file: `design/gallery.yaml`

`design/gallery.yaml (part)`

```yaml
pieces:
  - id: button
    component: components/Button
    for: The one action that moves the person forward on a screen.
    not_for: Navigation to another place (use link). More than one per screen (use button-quiet for the rest).
    variants: [primary, quiet, danger]
    states: [rest, hover, pressed, focus, disabled, busy]
  - id: product-card
    component: components/ProductCard
    for: One product the customer can add, with its photo, name, price and what is left today.
    combines_with: [stepper, quantity]
  - id: pickup-code
    component: components/PickupCode
    for: The code the customer shows at the counter. Only on the outcome of place-order.
combinations:
  - id: choose-and-confirm
    pieces: [product-card, quantity, button]
    for: Choosing several things and confirming once.
    rule: One primary button, at the bottom on a phone, at the side on a desktop.
patterns: [ … ]   # see Patterns
```

| Field                | What it says                                           |
| -------------------- | ------------------------------------------------------ |
| `id`                 | the piece's name, used by screen files                 |
| `component`          | where it lives in `src/design/`                        |
| `for`                | when to use it, in one sentence                        |
| `not_for`            | when not to, and what to use instead                   |
| `variants`, `states` | what the gallery shows                                 |
| `combines_with`      | pieces that are often next to it                       |
| `combinations`       | groups of pieces with a rule for how they sit together |

A piece that is not in `gallery.yaml` cannot be used on a screen: the agent proposes it first.

## The page

|               | Where                                                                             | Who sees it                                                             |
| ------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| **\[Engine]** | `npx @sypnia/design gallery` at `http://localhost:4520`                           | you                                                                     |
| **\[Cloud]**  | `design.app.sypnia.com/<organization>/<project>/gallery`, and in App's side panel | your organization's members; share links for others expire after 7 days |

For every piece it shows each variant and state, live, in light and dark, at phone and desktop width, next to its «for» and «not for», and the list of screens that use it.
