Using the wireframe tool with an AI assistant

Ask any AI assistant to design a layout, then copy and paste its layout text into the wireframe tool. There is no account, API or plugin, and nothing leaves your browser.

Quick start

  1. Copy the prompt below and fill in what you want to build.
  2. Paste it into your assistant. It reads the plain-text guide and replies with layout text in a code block.
  3. Copy the code block, open the tool, and open the Actions menu and choose Import layout…. Paste the text and click Replace canvas, or Add to canvas to keep existing elements.

For assistants that can open links:

Prompt
Design a wireframe for [describe your site or app, and whether you want a browser version, a phone version or both]. Read https://john-richardson.net/tools/wireframing/agents.txt for the layout format (if you can't open links, tell me and I'll paste it). Reply with the layout text in one code block that I can paste into the tool's Import dialog. Use frame sections for each version. Do not put the layout in a URL.

Works with any assistant, even one that can't browse the web. It contains the whole format:

Full prompt
I'm using a free online wireframe tool that imports a simple text layout. Design a wireframe for: [describe your site or app, and whether you want a browser version, a phone version or both].

Reply with ONE code block containing only the layout text (no commentary inside it) and a one-line note outside it. Do not put the layout in a URL.

FORMAT - one element per line:
type [x y w h] ["text"]
- Sections (coloured full-width bands) and boxes take an optional fill, e.g. section 0 0 1200 300 bg=#fef08a. List a section before the elements that sit on it.
- Headings take an optional text size after the numbers, e.g. heading 0 0 600 60 size=36 "Title". Without it they use 28. Their height does not change the text size, and long text wraps to the width.
- x y w h are pixels from the top left. Give all four, or none. With no numbers, lines stack top to bottom 20px apart (full-width types span the frame, others are centred).
- "text" is optional and always in double quotes.
- link="Page name" after the numbers makes an element link to that page. "page Name" on its own line starts a new page (several pages make a site; the first is home), then "frame browser" / "frame phone" lines for that page. Without page lines it is one page.
- "frame browser" (1200px wide) or "frame phone" (390px wide) on its own line starts a section. The page can be any height.
- Later lines draw on top. Align to a 20px grid. Keep text short. Use 8 to 30 elements.
- The tool keeps 40px side margins. Browser: keep content between x=40 and x=1160 (three cards: x=40, 420, 800 at w=360). Phone: content between x=40 and x=350, one column. Sections (coloured bands) span the whole frame, x=0 to the frame width. Navbar, hero and footer sit between the margins (x=40, 1120 wide in the browser frame, 310 wide in the phone frame).

ELEMENT TYPES (default size):
rect (200 x 120) - text: optional label centred in the box
circle (120 x 120)
heading (360 x 40) - text: the heading text
paragraph (360 x 80)
button (140 x 44) - text: button label
divider (360 x 20)
image (280 x 180) - text: caption under the placeholder icon
video (400 x 225)
avatar (64 x 64)
logo (150 x 44) - text: wordmark next to the logo mark
input (280 x 44) - text: placeholder text
checkbox (200 x 28) - text: label
list (280 x 140)
form (360 x 340) - text: form title (Name, Email, Message and Submit are drawn automatically)
navbar (full width x 70) - text: logo text
floatnav (480 x 56) - text: comma-separated menu items (first is highlighted)
menu (360 x 32) - text: comma-separated menu items (first is underlined)
burger (44 x 44)
dropdown (180 x 40) - text: placeholder text
menulist (190 x 170) - text: comma-separated menu items
usermenu (84 x 40) - text: optional user name
section (full width x 240) - text: optional label in the top left corner
hero (full width x 360) - text: headline
features (800 x 200)
cta (800 x 160) - text: banner heading
card (280 x 320) - text: card title
pricing (260 x 360) - text: plan name
testimonial (400 x 200) - text: person name
accordion (360 x 220) - text: comma-separated row titles (first row is open)
tabs (420 x 160) - text: comma-separated tab names (first is active)
slider (600 x 300)
table (560 x 220)
modal (420 x 260) - text: modal title
footer (full width x 140)

EXAMPLE:
frame browser
navbar 40 0 1120 70 "Acme"
hero 40 90 1120 400 "Plan trips together"
card 40 520 360 320 "Flights"
card 420 520 360 320 "Hotels"
card 800 520 360 320 "Cars"
cta 40 880 1120 160 "Join the beta"
footer 40 1080 1120 140

frame phone
navbar 40 0 310 70 "Acme"
hero 40 90 310 360 "Plan trips together"
card 40 480 310 320 "Flights"
footer 40 840 310 140

Layout format

One element per line:

Format
type [x y w h] ["text"]
  • x y w h are pixels from the top left. Give all four, or none for auto-layout.
  • "text" is optional and always in double quotes.
  • frame browser or frame phone on its own line starts a section for that frame. Browser is 1200px wide and phone is 390px wide. The page grows downwards, so any height works.
  • Lines with no numbers stack top to bottom, 20px apart. Navbar, hero and footer span the width and the rest are centred.
  • Later lines draw on top of earlier ones. Lines starting with # or // are ignored.

Example

Example
frame browser
navbar 40 0 1120 70 "Acme"
hero 40 90 1120 400 "Plan trips together"
card 40 520 360 320 "Flights"
card 420 520 360 320 "Hotels"
card 800 520 360 320 "Cars"
cta 40 880 1120 160 "Join the beta"
footer 40 1080 1120 140

frame phone
navbar 40 0 310 70 "Acme"
hero 40 90 310 360 "Plan trips together"
card 40 480 310 320 "Flights"
footer 40 840 310 140

Auto-layout example (no coordinates)

Auto-layout example
navbar "Acme"
hero "Plan trips together"
features
cta "Join the beta"
footer

JSON is also accepted: { "frame": "browser", "elements": [ { "type": "hero", "x": 0, "y": 90, "w": 1200, "h": 400, "text": "Headline" } ] }

Importing your layout

Copy the layout text from your assistant's code block. In the tool, open the Actions menu and choose Import layout…. Paste the text and click Replace canvas.

Browser and phone sections can be imported together. Choose where it goes with Import to: Desktop, Mobile or Both. Each frame keeps its own layout, and only the frames you choose change. With Both, a layout with browser and phone sections puts each in its own frame, and a layout without sections is used for both. Ask your assistant for both sections if the two frames should differ. Use Add to canvas if you want to keep your existing elements.

Sending feedback back

Select any element and type in its Note field to record an issue or a change. A yellow badge marks it on the canvas. Then open Import and click Copy layout with notes. Notes appear as note "..." lines under their element:

Layout with a note
hero 0 90 1200 400 "Plan trips together"
note "Headline too long; make the call to action more prominent"

Prompt to send with it:

Prompt
Here is my current wireframe layout. Lines starting with note are my feedback on the element directly above them. Apply the changes and give me the full updated layout in one code block, without the note lines, using the same format. If a note is unclear, ask me instead of guessing.

[paste the copied layout here]

Tips for good wireframes

  • Work top to bottom: navbar, hero, content sections, call to action, footer.
  • Align to a 20px grid, so x, y, w and h are multiples of 20.
  • Browser: keep content between x=100 and x=1100. Three cards sit at x=100, 450 and 800, each 300 wide.
  • Phone: keep a 20px margin, stack content in one column, and use a navbar, which shows a burger menu at that width.
  • Keep text short. Wireframes show structure, not copy.

For agents that control a browser

On the tool page, window.wireframe exposes the following interface:

  • load(text, options)

    Imports layout text or JSON.

    • text: string - Layout text (see the layout format) or JSON.
    • options.add: boolean (optional) - true appends to the canvas instead of replacing it. Default false.
    • options.target: 'browser' | 'phone' | 'both' (optional) - Limits the import to those frames. Without it, the text's own frame sections decide and replacing empties every frame the text does not cover.

    Returns { added: number, warnings: string[] }

  • export()

    The current layout as text, in the layout format, with every page included. It can be passed straight back to load(). It has no element ids; use list() for those.

    Returns string

  • save(name)

    Saves the project in the browser. With no name it saves under the current name; a project that has never been saved needs one. Saving under an existing name overwrites it, after the same confirmation as the Save button, which handlers added with on() can answer.

    • name: string (optional) - The project name.

    Returns Promise<{ ok: true, name } or { ok: false, error }>

  • frames()

    The size and margin of each frame, and the x and w to pass for an element to fill the space between the margins (content) or run edge to edge (full). Full-width types such as navbar, hero and footer already default to the margins, so you only need this to choose differently. The margins can be dragged by the user, so call it again rather than remembering the numbers.

    Returns { browser: FrameInfo, phone: FrameInfo }

  • list(filter)

    Lists elements, as copies of how they are now: changing one does not change the canvas, so use update() to edit. The ids it returns are what the calls below take. They change when the canvas is replaced or another project is opened, so call it again then.

    • filter.page: string | number (optional) - A page name or id.
    • filter.frame: 'browser' | 'phone' (optional) - Only elements in this frame.
    • filter.type: string (optional) - An element type, such as "button".

    Returns Element[] (every element when no filter is given)

  • get(id)

    Gets one element, as a copy of how it is now: changing it does not change the canvas, so use update() to edit.

    • id: number - An element id from list().

    Returns Element | null

  • update(id, patch)

    Changes only the fields given.

    • id: number - An element id.
    • patch: Patch - The fields to change, as listed under Element fields.

    Returns Result

  • move(id, position)

    Shortcut for update(id, { x, y }).

    • id: number - An element id.
    • position: { x: number, y: number } - The new left and top edge in pixels.

    Returns Result

  • resize(id, dimensions)

    Shortcut for update(id, { w, h }).

    • id: number - An element id.
    • dimensions: { w: number, h: number } - The new width and height in pixels.

    Returns Result

  • add(type, props, where)

    Adds an element. With no x and y it goes in the next free slot.

    • type: string - An element type (see Element types).
    • props: Patch (optional) - Starting values, as for update().
    • where: { page?, frame?, after? } (optional) - page is a page name or id and frame is "browser" or "phone"; both default to the ones the user has open. after is an element id to insert behind, as for insertAfter().

    Returns Result (element is the new one)

  • insertAfter(id, type, props)

    Adds an element directly after another: same page and frame, next to it in stacking and export order, and just below it unless props sets x and y. Nothing else moves.

    • id: number - The element to insert after.
    • type: string - An element type.
    • props: Patch (optional) - Starting values, as for update().

    Returns Result (element is the new one)

  • remove(id)

    Deletes an element.

    • id: number - An element id.

    Returns { ok: true, undoable } or { ok: false, error }

  • addPage(name)

    Adds an empty page at the end. It does not open it, so the user keeps seeing the page they were on.

    • name: string (optional) - The page name, which must be new. Defaults to "Page N".

    Returns PageResult

  • renamePage(page, name)

    Renames a page. Links to it keep working.

    • page: string | number - A page name or id.
    • name: string - The new name, which must not be used by another page.

    Returns PageResult

  • removePage(page)

    Deletes a page and its elements, and removes links to it. The home page (the first) cannot be deleted.

    • page: string | number - A page name or id.

    Returns PageResult (the page that was removed)

  • batch(label, fn)

    Runs several edits as one undo step.

    • label: string - The name shown for the undo step.
    • fn: () => T - A function that makes the edits.

    Returns Whatever fn returns

  • run(id)

    Runs a command by id, as if its button or shortcut was used. The commands property lists them.

    • id: string - A command id from commands, such as "undo".

    Returns boolean (false if there is no such command or it is not available now)

  • on(name, handler)

    Runs handler when an event happens. Events: saved, loaded, cleared, modeChanged, projectDeleted, imported, exported, unsavedWorkChanged ({ atRisk }), fullscreenChanged ({ on }) and zoomChanged ({ zoom }). It also hooks the events that fire before something happens: projectOpening, projectCreating, canvasReplacing, layoutLinkOpening, projectOverwriting, projectDeleting and canvasClearing. Handlers run in the order they were added, and the tool's own confirmation runs first.

    • name: string - An event name from the list above.
    • handler: (payload) => boolean | void - For the "before" events, return false to halt the action, true to allow it without the tool asking the user, or nothing to let the tool decide.

    Returns A function that removes the handler

It also has properties: version (The API version, a number.) guide (The address of the plain-text guide.) elements (The element types, with their default sizes and what their text is used for.) commands (The commands run() accepts, as { id, label, shortcuts }.)

Types

  • Element = { id, page, frame, type, x, y, w, h, text?, size?, fill?, link?, note? }. What list() and get() return. Fields that do not apply to the type are left out.
  • FrameInfo = { width, margin, content: { x, w }, full: { x, w } }. Numbers in pixels. For example, on a phone with 40px margins: { width: 390, margin: 40, content: { x: 40, w: 310 }, full: { x: 0, w: 390 } }.
  • Patch = { x?, y?, w?, h?, text?, size?, fill?, link?, note? }. The editable Element fields, all optional. null clears text, size, fill, link or note.
  • PageResult = { ok: true, page: { id, name } } or { ok: false, error: string }. What the page calls return. Like Result, they never throw and a failed call changes nothing.
  • Result = { ok: true, element, undoable: boolean } or { ok: false, error: string }. Edits never throw, and a failed edit changes nothing. Undo covers the page and frame the user has open, so edits to another page or frame return undoable: false.

Element fields

The editable ones are what a Patch can set. A field that does not apply to an element (no text, no fill and so on) is left out of results and rejected in a patch.

FieldTypeEditableMeaning
id number no Identifies the element.
page string no The name of the page it is on.
frame 'browser' | 'phone' no The frame it is in.
type string no The element type.
x number yes Left edge in pixels, kept inside the frame.
y number yes Top edge in pixels.
w number yes Width in pixels, kept inside the frame and above the minimum size.
h number yes Height in pixels, above the minimum size.
text string | null yes The element's text, for types that use text. null clears it.
size number | null yes Text size, for types that have one. null resets it.
fill string | null yes Fill colour as #rrggbb, for types that take a fill. null resets it.
link string | number | null yes The page it links to. Read back as a page name; set with a page name or id. null removes the link.
note string | null yes Feedback attached to the element. null removes it.

Element types

Basic

Type Default size Text
rect 200 × 120 optional label centred in the box
circle 120 × 120 not used
heading 360 × 40 the heading text
paragraph 360 × 80 not used
button 140 × 44 button label
divider 360 × 20 not used

Media

Type Default size Text
image 280 × 180 caption under the placeholder icon
video 400 × 225 not used
avatar 64 × 64 not used
logo 150 × 44 wordmark next to the logo mark

Forms

Type Default size Text
input 280 × 44 placeholder text
checkbox 200 × 28 label
list 280 × 140 not used
form 360 × 340 form title (Name, Email, Message and Submit are drawn automatically)

Navigation

Type Default size Text
navbar full width × 70 logo text
floatnav 480 × 56 comma-separated menu items (first is highlighted)
menu 360 × 32 comma-separated menu items (first is underlined)
burger 44 × 44 not used
dropdown 180 × 40 placeholder text
menulist 190 × 170 comma-separated menu items
usermenu 84 × 40 optional user name

Blocks

Type Default size Text
section full width × 240 optional label in the top left corner
hero full width × 360 headline
features 800 × 200 not used
cta 800 × 160 banner heading
card 280 × 320 card title
pricing 260 × 360 plan name
testimonial 400 × 200 person name
accordion 360 × 220 comma-separated row titles (first row is open)
tabs 420 × 160 comma-separated tab names (first is active)
slider 600 × 300 not used
table 560 × 220 not used
modal 420 × 260 modal title
footer full width × 140 not used

Something missing?

If an element or option would make this easier for you or your assistant, let me know.

Contact me

© John Richardson Development. All rights reserved.