# For AI & LLMs (/work/petavue-design-system/docs/ai) Coding agents build screens faster when they work from the design system instead of guessing. This site gives them the same information people read, in plain text. ## Files for agents [#files-for-agents] | Address | What it is | |---|---| | [/llms.txt](/work/petavue-design-system/llms.txt) | An index of every page, with a one-line summary and a link to its Markdown | | [/llms-full.txt](/work/petavue-design-system/llms-full.txt) | Every page in one file, for agents that read everything up front | | `/llms.mdx/docs//content.md` | One page as Markdown, such as [the Button page](/work/petavue-design-system/llms.mdx/docs/components/button/content.md). "Copy Markdown" at the top of every page copies the same text. | These files are built from the same MDX that renders this site (`design-system/content/docs`), so they cannot fall out of date with it. Live examples appear on the site only; the Markdown keeps the code next to them. ## Starting an agent [#starting-an-agent] Give the agent this before it writes any UI: ```text Before writing UI for this project, read /llms.txt and the pages it links that match the task (always: Getting started, Colour, Typography, Writing, and the components you will use). Use components from @/ui and tokens from the CSS variables. Follow the rules in /llms.mdx/docs/ai/content.md. If something you need is not in the design system, say so instead of inventing it. ``` ## Rules for agents [#rules-for-agents] 1. **Import from `@/ui`.** Never re-create a component that exists there, and never import from a component's folder. 2. **Use tokens.** `var(--color-…)`, `var(--spacing-…)`, `var(--radius-…)`, `var(--shadow-…)`. Do not write hex values, and do not invent token names: if it is not in [Colour](/work/petavue-design-system/docs/foundations/colour) or [Spacing](/work/petavue-design-system/docs/foundations/spacing), it does not exist. 3. **Product palette only.** Primary blue for actions, greys for structure, green, red and orange for status. Never purple for anything new. 4. **Text is 14px or 12px** in the interface. Titles use the type scale. Nothing below 12px. 5. **Menus use the dropdown menu** in `@/components/shadcn/dropdown-menu` with a Petavue Button as the trigger. 6. **Icons are Phosphor**, sized to the text: 14px next to 12px text, 16px next to 14px text. 7. **One primary button per area.** Everything else is `secondary`, `secondaryGhost` or `ghost`. 8. **Copy follows [Writing](/work/petavue-design-system/docs/foundations/writing):** sentence case, no exclamation marks, no taglines, no "powerful" or "seamless", no dashes joining a slogan to a claim. 9. **Class names describe the thing** (BEM: `campaign-card__title`). Tailwind is for page layout. 10. **Do not edit shared components for a one-off.** Style around them with a scoped class, and say what you changed. 11. **Verify in the browser.** Build, open the screen, check the console is clean, and look at it at 1440 and 1280 pixels wide. ## Keeping this site current [#keeping-this-site-current] - Tokens on the Foundations pages are read from `src/ui/tokens/tokens.css`, `src/ui/colorography/tokens.css` and `src/ui/typography/typography.css`. Change a token there and the site updates. - Component pages are MDX files in `design-system/content/docs/components`, with live examples in `design-system/app/live`. When you change a component's props, update its page in the same change. - A new page needs only an MDX file with `title` and `description` at the top, and its name in the folder's `meta.json` to set its place in the sidebar. It then appears in search, in `/llms.txt` and as Markdown automatically. # Avatar (/work/petavue-design-system/docs/components/avatar) ```jsx import { Avatar } from "@/ui"; ``` Avatar matches the Figma **Avatar** and **Profile** components. Figma splits them in two; in code they are one component with a `type` prop. ## Types [#types] The fill says who the person is. Use `profile` for the signed-in user, and `admin` or `user` when you list people by role. ```jsx ``` | `type` | Fill | Token | |---|---|---| | `profile` | #E0EBFE | `--color-primary-100` | | `admin` | #FCE9F4 | `--color-tag-pink` | | `user` | #E0FDFF | `--color-tag-blue` | ## Sizes [#sizes] ```jsx ``` | `size` | Circle | Text | |---|---|---| | `lg` (default) | 40px | 14px medium | | `sm` | 24px | 12px regular | Figma sets the small avatar's initials at 10px. Code uses 12px, because 12px is the smallest text in the product. ## States [#states] Pass `onClick` and the avatar becomes a button: hovering turns the initials blue. `active` adds a 1px blue ring. Use it while the avatar's menu is open. ```jsx ``` | Figma state | In code | |---|---| | Rest | default | | Hover | `:hover` when `onClick` is set | | Active | `active` | | Active hover | `active` plus `:hover` | ## In a list [#in-a-list] Use `sm` beside a 14px name. The role goes in its own column as text, so the colour is never the only signal. ```jsx ``` ## Props [#props] | Prop | Type | Default | Notes | |---|---|---|---| | `initials` | `string` | `""` | One or two letters. Shown in upper case. | | `name` | `string` | | Full name. Used as the tooltip and the accessible label. | | `type` | `"profile" \| "admin" \| "user"` | `"profile"` | Sets the fill. | | `size` | `"lg" \| "sm"` | `"lg"` | 40px or 24px. | | `active` | `boolean` | `false` | Blue ring. Also sets `aria-pressed` on a button. | | `onClick` | `function` | | Renders a `