Cookbook Introduction
Production-grade project patterns, file structures, and vertical slice architecture for Standard.
The Standard Cookbook provides complete, production-grade architectural blueprints for real-world projects built with the Standard framework (@stnd/*). Rather than isolated code snippets, each recipe specifies the entire file tree, module manifests, routing conventions, and typographic layout rules required to deploy an application cleanly on edge environments.
Architectural Principles
Every recipe documented in this manual adheres to the four non-negotiable invariants of the Standard system:
- Vertical-slice modules (
@modules/): Application features live in discrete, isolated folders withinmodules/. Each slice manages its own routes, components, styles, and content. Slices never climb through parent folders with relative paths. - Logic-free
.astrofiles:.astrofiles serve exclusively as layout shells, view templates, and markup orchestrators. Data manipulation, business rules, and transformations reside in pure TypeScript/JavaScript helper modules. - Typography and Grid by Default: Layouts consume the mathematical grid (
grid-12), optical line measures (prose,inky,box), and the OKLCH design tokens shipped by@stnd/styleswithout ad-hoc utility clutter. - Instant Scaffolding via CLI: Every project architecture in this cookbook can be scaffolded immediately using the
@stnd/clicommand-line interface.
Available Recipes (From Simplest to Most Advanced)
The recipes are structured in order of progressive complexity — starting with atomic vanilla HTML building blocks, progressing through single-page and multi-page publishing architectures, and concluding with deep module extensions.
| Recipe | Level | Description | CLI Command |
|---|---|---|---|
| 1. Vanilla-First UI Patterns | Atomic / Micro | Copy-paste HTML patterns (editorial cards, switches, metric grids, split views, user profiles) built strictly with semantic HTML and CSS utilities — zero JS | stnd.build/patterns |
| 2. Landing Page | Single-Page | High-impact showcase layout with Swiss grid hero, feature columns, and live typography specimen | stnd new my-product --template landing |
| 3. Personal Blog | Multi-Page | Clean publishing platform with Markdown posts, reading time calculation, tag filtering, and book-quality reading rhythm | stnd new my-blog --template blog |
| 4. Add Anything to Standard | Advanced / Module | How to add custom or licensed fonts, local themes, UI components, routes, and hooks in ./modules/ without touching framework source code |
modules/<name>/index.module.js |
| 5. Digital Garden | Full System | Exploratory knowledge base with bidirectional wiki-links and vault synchronization (default template) | stnd new my-garden --template garden |
| 6. Custom SCSS Intention | Craft / Styles | Architectural blueprint for bespoke typographic intentions and design tokens using SCSS, OKLCH ladders, and 1rlh harmonics | modules/intention-<name>/ |
| 7. Photo Essay & Visual Story | Media / Editorial | High-fidelity visual storytelling, responsive zero-JS multi-column galleries, and EXIF metadata inspired by Reveal Story mode | stnd new my-photo-story --template photo |
Choose a recipe from the sidebar to inspect its file topology and implementation specifications.