# Your components

> Pieces with your look, generated into your repository, and yours to keep and change.

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

For agents: Your components: generated by design components generate into src/design/ (configurable in the [design] table of sypnia.toml, components.dir): one folder per piece (Button.tsx + Button.module.css + README.md), index.ts exporting all, written as ordinary React + CSS modules over @sypnia/base using only tokens. The generator writes structure and accessibility wiring; the look comes from the guide's shape language and tokens; the agent with the sypnia-design-guide skill tailors pieces to the brand. Brand pieces beyond the base (ProductCard, PickupCode, Stepper) are composed from base pieces. Ownership: plain source in the customer's repo, edit freely; each file records generated-from guide version and a hash; components status shows untouched/edited/out of date; regeneration after a guide change is a three-way merge in a pull request; edited parts are never overwritten silently. Frameworks: React (Next.js, Vite, Astro with React); tokens.css usable anywhere.

Your pieces live in **your** repository, as ordinary React and CSS. Design generates them from your guide; after that, they are yours.

## What gets generated

```text
src/design/
├─ index.ts                 every piece, exported
├─ tokens.css → ../../design/tokens.css
└─ components/
   ├─ Button/
   │  ├─ Button.tsx         your look over @sypnia/base's Button
   │  ├─ Button.module.css  only tokens, no raw values
   │  └─ README.md          what it is for, from the gallery
   ├─ TextField/ …
   ├─ ProductCard/          a piece of your own, made of base pieces
   └─ PickupCode/
```

There are two kinds of pieces:

| Kind                           | Examples                                                        | Made from                     |
| ------------------------------ | --------------------------------------------------------------- | ----------------------------- |
| **Base pieces with your look** | Button, TextField, Select, Dialog, Sheet, Menu, Tabs, Toast     | one `@sypnia/base` piece each |
| **Pieces of your own**         | ProductCard, PickupCode, Stepper («Choose → Confirm → Pick up») | several base pieces, composed |

The generator writes the structure and the accessibility wiring. The look comes from your guide: its tokens and its shape language (corners, fills or outlines, shadows or borders). The agent, with the [Design skills](https://design.docs.sypnia.com/skills), tailors each piece to your brand, so two bakeries with the same pieces still look like two bakeries.

## Yours to change

The files are plain source code. Change them as you like: a different hover, an extra variant, a piece rewritten by hand. Design keeps track of what it generated:

```bash
npx @sypnia/design components status
```

```text
Button        up to date (guide 3)
ProductCard   edited by you
Stepper       out of date: guide 4 changed radius.card
```

## When the guide changes

A change to the guide regenerates the affected pieces in a **pull request**. For a piece you edited, Design merges its new version with your changes, keeps yours where they touch the same lines, and shows the conflicts for you or your agent to resolve. Your edits are never overwritten silently.

## Frameworks

Generated pieces are React (Next.js, Vite, or Astro with React; static pages render them on the server). `design/tokens.css` works in any framework, so a page outside React can still use your colours, fonts and spacing.
