Quick Start
This guide will walk you through creating your first screen definition and viewing it in the Screenbook UI.
-
Create a screen.meta.ts file
Create a
screen.meta.tsfile alongside your route/page file:src/pages/dashboard/screen.meta.ts import { defineScreen } from "screenbook"export const screen = defineScreen({id: "dashboard",title: "Dashboard",route: "/dashboard",owner: ["platform-team"],tags: ["core"],}) -
Build the screen catalog
Run the build command to generate the screen metadata:
Terminal window npx screenbook buildThis creates:
.screenbook/screens.json- All screen metadata.screenbook/graph.mmd- Navigation graph in Mermaid format.screenbook/coverage.json- Coverage statistics
-
Start the development server
View your screens in the Screenbook UI:
Terminal window npx screenbook devOpen http://localhost:4321 to see your screen catalog.
-
Add navigation relationships
Define how screens connect to each other:
src/pages/dashboard/screen.meta.ts export const screen = defineScreen({id: "dashboard",title: "Dashboard",route: "/dashboard",owner: ["platform-team"],tags: ["core"],next: ["settings", "profile"], // Screens this page links to})src/pages/settings/screen.meta.ts export const screen = defineScreen({id: "settings",title: "Settings",route: "/settings",owner: ["platform-team"],tags: ["core"],entryPoints: ["dashboard"], // Screens that link here}) -
View the navigation graph
Rebuild and refresh the UI to see the navigation graph:
Terminal window npx screenbook buildnpx screenbook devNavigate to the Graph view to see how your screens connect.
Auto-generate screen.meta.ts files
Section titled “Auto-generate screen.meta.ts files”If you have many routes, you can auto-generate screen.meta.ts files:
npx screenbook generateThis scans your route files and creates skeleton screen.meta.ts files that you can customize.
Next Steps
Section titled “Next Steps”- Configuration - Customize patterns and output
- Define Screens - Learn all screen metadata fields
- Navigation Graph - Understand screen relationships
- Framework Examples - See working examples for Next.js and Vite