Adding a sketch to the playground is a two-step process: create the Vue component inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/hetari/creative-coding/llms.txt
Use this file to discover all available pages before exploring further.
src/sketches/, then register it in src/config/sketches.ts. Because the playground uses a fully dynamic routing architecture (src/pages/[...all].vue), you never need to create any files inside src/pages/ — the registry entry alone is enough to wire up the route, dashboard card, and preview.
Create the sketch component
Create a The
.vue file at src/sketches/<category>/<sketch-name>/index.vue. The example below uses the useP5 composable to mount a p5.js canvas that follows the mouse cursor:Default layout provides the standard page shell (dark background, overlay slots). The ref="container" div is the mount target that useP5 attaches the p5 canvas to.Register in SKETCHES
Open The
src/config/sketches.ts and add an entry to the SKETCHES array. Every field in the SketchMeta interface is required except resources:component field is a dynamic import factory. The playground lazy-loads the sketch module only when the route is visited or the preview card scrolls into view.Open the dashboard
Start the dev server if it isn’t running:Navigate to http://localhost:5173. Your sketch card appears automatically in the correct category section, using the
previewMode you set. No additional routing configuration is needed.SketchMeta Fields
Every entry in theSKETCHES array must conform to the SketchMeta interface exported from src/config/sketches.ts. The table below documents each field:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the sketch. Must be globally unique across all sketches. Used as a stable key when referencing the sketch in tooling and tests. |
title | string | Human-readable display title shown on the dashboard card header. |
category | string | Slash-separated category path, e.g. 'gsap/footer'. Controls which dashboard page the sketch appears on and determines the nested route hierarchy. |
path | string | Full URL path without trailing slash, e.g. '/shader/learn'. Must match the physical location implied by category + sketch name. |
order | number | Sort key; lower numbers sort first on the dashboard. Used by buildDashboardItems() to arrange cards. |
previewMode | 'image' | 'iframe' | Controls which preview renderer the dashboard card uses. See Preview Modes for details. |
resources | string[] | Optional array of reference URLs (tutorials, docs, videos) surfaced by the <ResourcesList> overlay component. |
component | () => Promise<{ default: Component }> | Dynamic import factory for the sketch Vue component. Called by [...all].vue when the route is matched. |
Ordering and Sorting
Theorder field is an integer sort key. Dashboard cards are sorted in ascending order so the sketch with order: 0 appears first. Use gaps between values (0, 10, 20, 30 …) rather than sequential integers so you can insert new sketches between existing ones without renumbering the entire list.
buildDashboardItems() reads the minOrder of all sketches that share the same category prefix to determine how to order category folder cards relative to leaf sketch cards on the same dashboard page.