Turn UI Components into Dimensioned Spec Sheets
Document a UI component's dimensions and structure on one readable drawing sheet. Generate editable HTML with spacing, radii, layer views and variable tables, then optionally animate it with the companion skill.
Works with Claude Code · Codex · Cursor · Gemini CLI
Requirements
- Node.js >=22.20 (skills CLI)
Overview
What you get
- An editable HTML spec sheet with an SVG plan view, exploded layers, detail views and dimension tables.
- Variable codes that connect drawing labels to measured values and formulas.
- An optional short MP4 made with the companion dimensional-drawing-motion skill.
Good fit
- Recording component spacing, corner radii and layout rules for design handoff or documentation.
- Updating a drawing when a card, dialog or other component changes.
Tutorial
Read a component spec sheet
A screenshot shows how a component looks. A handoff also needs its spacing, corner radii and layer relationships. dimensional-drawing analyzes component code, pages or screenshots and documents that structure in an HTML drawing you can open in a browser.
Watch the creator’s dialog demo above and look for three parts:
- Plan view: wireframes show the title, content and action areas, with codes beside the dimensions.
- Exploded view: the scrim, shadow, container and content separate to show their stacking order.
- Variable tables: codes such as
S1andR1connect dimensions to spacing, radii and formulas.
In the drawing, HUG means sized by content, FLEX means taking the remaining space, and FILL means filling the parent’s width. Text becomes placeholder regions so the sheet focuses on layout.
Choose between this and Anatomy
- dimensional-drawing: document the dimensions and structure of an existing UI component for handoff or reference.
- Anatomy: explain technical concepts through interactive mechanical diagrams.
Install the skills and choose a source
-
Run this command in a terminal. This installation method needs Node.js 22.20 or later.
npx skills add enesozturk/dimensional-drawingThe installer lets you choose skills and an AI tool. Select
dimensional-drawing; adddimensional-drawing-motionif you want to make a film. -
Open your practice folder in the AI tool you selected. Send the requests below in its chat, with the component files available for it to read.
-
Supply component source code or a Storybook page. You can also use a URL or screenshot. Source code and a rendered page make it easier to read actual styles. With a screenshot, provide known measurements and leave missing values as
[TBD]in the drawing.
For manual installation, copy the complete skill folder, including examples. The motion skill also needs templates and adapters. See the repository for the folder layout.
Draw your first card
This practice exercise was prepared by Opuskill. Start with explicit component values, then find them in the drawing.
-
Create
practice-card.htmlin your practice folder, paste this code and open it in a browser.<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>Card practice</title> <style> * { box-sizing: border-box; } body { margin: 0; padding: 40px; font: 16px/1.5 system-ui; } .card { width: 360px; padding: 24px; display: grid; gap: 12px; border: 1px solid #ccc; border-radius: 16px; } .card h2, .card p { margin: 0; } .card button { justify-self: start; padding: 8px 16px; border: 1px solid #111; border-radius: 8px; font: inherit; background: #fff; } </style> <article class="card"> <h2>Project progress</h2> <p>See this week's tasks and next steps.</p> <button type="button">View details</button> </article> </html>You should see a 360px-wide card containing a heading, text and a button.
-
Send this request in your AI tool’s chat:
Use dimensional-drawing to document .card in practice-card.html. Read the source and measure its rendered layout in a browser. Follow the skill's card example for the plan view, exploded layers, corner details and variable tables. Use monochrome lines and replace the heading, body and button text with placeholder regions. Give every dimension a code, with its variable name and value in a table. Mark unknown values [TBD]. Keep the component source file and save the drawing as a standalone card-spec.html. Open the drawing and check for overlapping labels before delivering it. -
Open
card-spec.html. Find the width, container padding, vertical gap and outer radius. They should map to360,24,12and16. Codes may differ; their table entries should describe the dimensions they label.
To compare sheet layouts, download the creator’s card and dialog HTML examples and open them in a browser.
Check the dimensions and change one value
-
Compare the drawing with
practice-card.html. Follow each dimension to its table entry. For any[TBD]value, identify the missing information and supply its source or leave it unresolved. -
Send this follow-up in the same AI chat:
Change .card padding in practice-card.html from 24px to 32px. Keep the overall width at 360px, gap at 12px and outer radius at 16px. Measure the component again. Update the plan view, variable tables and affected formulas in card-spec.html. -
Refresh both HTML files. The content should sit farther from the border, and the padding variable should now be
32. Withborder-boxand a 1px border, the content width changes from310pxto294px; the overall width stays360px.
Keep the source and drawing in sync. Changing a number on the sheet alone will leave it out of step with the component.
Apply it to your own component
Choose a component from your project and enter its file path or page URL in the request below. Start with one component in one state, and tell the AI what to inspect.
Fill in this request and send it in your AI chat:
Use dimensional-drawing to document this component.
Source file or page: [actual path, Storybook URL or webpage]
Component and state: [for example, settings dialog, open]
Viewport: [width and height]
Focus: [for example, margins, maximum height, scrim and button alignment]
Known dimensions: [design variables or specifications; leave blank if none]
Output: [HTML filename]
Read the source and measure it before drawing. Use [TBD] for unknown values.
For a dialog, inspect its viewport placement and the layers of the scrim, container and actions. For navigation or a page layout, use a view for each relevant breakpoint. Choose views that help someone understand the component.
Optional: turn the drawing into a film
The companion dimensional-drawing-motion skill draws the lines, pulls the camera back and separates the layers. The video above is the creator’s 11-second dialog example.
Export an MP4 locally
The local renderer needs Node.js 18+, ffmpeg and Playwright’s Chromium. Prepare the skills installer using the Node.js requirement given earlier.
-
Clone the repository and install the animation adapter’s dependencies in a terminal:
git clone https://github.com/enesozturk/dimensional-drawing cd dimensional-drawing/skills/dimensional-drawing-motion/adapters/headless npm installInstallation also downloads the Chromium browser used by Playwright.
-
From this terminal directory, render one frame of the creator’s example:
node render.mjs --scene ../../templates/scene-dialog.js \ --css ../../templates/base.css --still 6.6 --out frame.pngOpen
frame.pngand check that labels are readable and layers are clear. Then render the full film:node render.mjs --scene ../../templates/scene-dialog.js \ --css ../../templates/base.css --out dialog.mp4The default output is an 11-second, 1920×1080 MP4 at 60 fps.
-
To animate your card, give the AI tool access to both the drawing and the cloned repository, then send:
Use dimensional-drawing-motion to make an 11-second film of card-spec.html. Start from scene-dialog.js and base.css in the cloned repository, and create a separate scene-card.js. Transfer the card's actual geometry, labels and layers into that scene and adjust the camera positions. Render key frames for my review before rendering the MP4. Give me the actual render command and paths for scene-card.js.The renderer takes an animation scene in JavaScript and a stylesheet. In this step, the AI adapts the HTML drawing into that scene.
Use Claude Motion
If your Claude environment offers a Motion Artifact, supply the finished drawing in chat and ask dimensional-drawing-motion to animate it. Review the timeline and export MP4 from the Motion interface. See the repository’s Claude Motion adapter instructions for setup details.