Daily Vibe Challenge

Challenge #006 ·

Napkin Spec: Turn Plain Text into a Clickable Phone Prototype

Beginner1–3 hoursRapid prototyping

Description

Build a tiny prototyping tool where you type an app idea as a few lines of indented plain text and instantly get a clickable phone mockup beside it. Screens, buttons, lists and inputs render live, buttons jump between screens, and the whole prototype lives in the URL so you can share it with one link. It is the fastest possible loop from "what if the app did this?" to something a friend can tap through on their phone.

Starter Prompt

Build "Napkin Spec", a browser tool that turns a short indented text spec into a live, clickable phone prototype. Use a single index.html plus app.js and style.css, vanilla JS, no build step, no backend, no external libraries.

Layout:
- Left half: a monospace textarea editor with line numbers. Right half: a phone frame (about 390x780, rounded corners, notch) that renders the current screen.
- Re-render on every keystroke (debounced ~150 ms). Parse errors show inline under the editor with the line number, and the last valid render stays visible.

Spec language (document it in a Help panel):
- "# Screen Name" starts a screen. The first screen is the start screen.
- Lines inside a screen are components, one per line:
  title: Some heading
  text: A paragraph of text
  button: Label -> Other Screen        (tapping navigates to that screen)
  input: Placeholder text
  list: Item one, Item two, Item three  (each item may use "-> Screen" to navigate)
  image: a short caption               (render a grey placeholder box with the caption)
  tabs: Home, Search, Profile           (bottom tab bar; each tab navigates to the screen of the same name)
  back                                 (a back arrow in the header using navigation history)
- Comments start with //. Blank lines are ignored. Indentation is optional.
- Validate links: a "-> Missing Screen" shows a warning in the error panel and the button gets a dashed red outline.

Prototype behavior:
- Tapping buttons/list items/tabs navigates with a quick slide transition; keep a history stack for back.
- A screen picker dropdown above the phone jumps to any screen. A "Restart" button returns to the start screen.
- "Flow map" toggle: replace the phone with a simple SVG graph of screens as boxes and links as arrows (auto-layout in a grid is fine).

Sharing and saving:
- Encode the spec into the URL hash (base64 of UTF-8 text, compressed with CompressionStream if available, plain base64 fallback). Loading a URL with a hash restores it.
- "Copy share link" button. Autosave to localStorage too.
- "Present" mode: hide the editor and center the phone full screen, so the link works as a demo on a real phone.

Ship it with a built-in example spec for a 4-screen coffee-ordering app (Menu, Item Detail, Cart, Order Placed) that shows off every component type.

When done, explain the parser design, list the spec syntax, and suggest 3 ways an LLM could plug in later (e.g. generating a spec from a one-sentence idea).

Success Criteria

Optional Extensions

Built it? Share your build and get featured in the showcase & weekly roundup: Submit your build →

Plain markdown: 006-text-spec-clickable-prototype.md

⚡ Get tomorrow's challenge before everyone else

One fresh challenge + copy-paste starter prompt in your inbox every morning, plus a weekly roundup of the best community builds. Free, no spam, unsubscribe in one click.

Or follow on Bluesky · RSS/Atom · Newsletter archive