UI design tools and design documentation
Practical notes on UI design tools and design documentation: what each deliverable is, how to create and measure assets, and how to hand off designs to developers.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
User-interface (UI) design tools and design documentation are what let engineers, designers and stakeholders share an exact, testable description of how an interface should look and behave. Engineers use these documents and exported assets to implement pixel-accurate layouts, responsive rules, interactions and accessible behaviour in code.
Key ideas
Start with definitions (I define each term before using it):
- UI design tools — software used to create visual designs, layouts, prototypes and exported assets. Examples: Figma, Sketch; Adobe XD (legacy, no longer actively developed). These let you draw, place, group and annotate visual elements.
- Design documentation — the written and annotated artefacts that describe a UI for implementers. Includes wireframes, high-fidelity mockups, component specifications, style guides, interaction details and export assets.
- Wireframe — a low-fidelity diagram of layout and content structure showing placement and priority without final visuals (colours, images). Use wireframes to decide structure before style.
- Prototype — a clickable or interactive model of the UI that simulates flow and behaviour; fidelity may be low (click-through) or high (animated transitions).
- Style guide — a document listing the visual rules: colours, typography, spacing units, iconography rules and component appearance. A design system is a larger, versioned collection of components, tokens (variables) and rules that scale across products.
- Component — a reusable UI element (e.g., button, input, card) with defined anatomy, states and properties. Atomic design is a method: atoms → molecules → organisms → templates → pages.
- Redlines / Specs — exact measurements, spacing, colours and behaviours annotated on designs so developers can reproduce them. Also called "developer handoff" documentation.
- Asset — a file exported for use in the product (icons, images, SVGs). Exported assets must match intended pixel densities and formats.
- Fidelity — how closely a representation matches the final product visually and behaviourally; low-fidelity = sketches/wireframes, high-fidelity = visual mockups and interactive prototypes.
Exact statements and assumptions often required in exams:
"A design handoff must contain: a) the final visual mockup(s) at target screen sizes, b) a style guide with tokens for colours and typography, c) component specs including states, d) asset exports at required device scales, e) interaction notes and accessibility requirements (contrast, labels)." This is prescriptive: assume medium-to-high fidelity and that developers need pixel/measure information.
"Spacing and layout should use a consistent grid (assume 8-point grid unless specified)." Define the grid: a vertical and horizontal rhythm where all sizes and spacings are multiples of 8 in the platform's unit (dp/pt/px). Assumption: consistent spacing simplifies responsive rules.
"For mobile density conversion, Android uses mdpi = 160 dpi baseline." State this when converting dp (density-independent pixels) to px. For text on Android, use sp (scale-independent pixels) so sizes respect user accessibility settings.
What to draw in exam diagrams (describe exactly):
For a component spec diagram: draw a rectangle representing the component. Label its width (W) and height (H) in the platform unit (dp/pt/px). Draw and label inner padding (left, right, top, bottom). Draw any child elements (icon, text) and label distances between elements. Indicate state changes (default, hover/focus/disabled) in three small side-by-side rectangles.
For an export scale diagram: draw the same icon at three sizes side-by-side labelled @1x, @2x, @3x and the pixel dimensions under each.
Formulas
px = dp × (dpi / 160)
- px: pixels (unit: pixel, not SI but common). dp: density-independent pixels (Android logical unit). dpi: screen dots-per-inch (unit: inch⁻¹). Applies when converting Android design density-independent units to physical pixels. Assumes Android baseline mdpi = 160 dpi.
DPI = pixels / inches
- DPI: dots-per-inch (unit: inch⁻¹). pixels: number of pixels along measurement. inches: physical measurement size in inches. Use to compute printing size or verify screen density. For screens, PPI (pixels-per-inch) is the more precise term; formulas are the same and many tools label it as PPI.
physical_size_mm = (pixels / DPI) × 25.4
- physical_size_mm: size in millimetres (mm). pixels: pixel count. DPI: dots-per-inch. 25.4 mm = 1 inch. Use for printed output or when converting design pixels to real-world size.
scale_factor = target_px / source_px
- scale_factor: multiplier to resize assets. target_px and source_px: pixel dimensions. Use for calculating image export sizes for responsive breakpoints or multiple densities.
Note on platform scales (reference facts to verify):
- iOS points to pixels: iOS uses @1x, @2x and @3x scales where 1 point = 1 @1x pixel, but device pixel ratio varies by device. (Check specifics per device.)
- Android density buckets: ldpi ≈ 120 dpi, mdpi = 160 dpi, hdpi = 240 dpi, xhdpi = 320 dpi, xxhdpi = 480 dpi, xxxhdpi = 640 dpi.
Worked examples
Example 1 — DPI and printed size (numerical, carry units):
Question: An image is 1200 × 800 px. If printed at 300 DPI, what size will it be in inches and millimetres? Steps:
- Formula:
physical_size_inches = pixels / DPI. - Width in inches = 1200 px / 300 DPI = 4.0 in.
- Height in inches = 800 px / 300 DPI = 2.666... in.
- Convert to millimetres: multiply by 25.4.
- Width in mm = 4.0 × 25.4 = 101.6 mm.
- Height in mm = 2.666... × 25.4 = 67.733... mm ≈ 67.73 mm.
Final answer: 4.00 in × 2.67 in (101.6 mm × 67.73 mm).
Example 2 — Android dp to px conversion (numerical):
Question: Design width is 360 dp. Target device has screen density 480 dpi. What is the width in px? Steps:
- Formula:
px = dp × (dpi / 160). - Substitute: px = 360 × (480 / 160) = 360 × 3 = 1080 px.
Final answer: 1080 px.
Example 3 — Asset export and handoff (procedural):
Question: You have a 24 px icon in your design system. Create assets for @1x, @2x and @3x. Steps:
- Source size: choose a high-resolution master, usually @3x: 24 px at @1x means 72 px at @3x. Decide source: 72 px (width and height) in SVG or PNG.
- Compute @2x size: scale_factor = 2/3. 72 × (2/3) = 48 px.
- Compute @1x size: 72 × (1/3) = 24 px.
- Export files named icon@1x.png (24×24), icon@2x.png (48×48), icon@3x.png (72×72). Also export as SVG for scale-independent use.
Also include a small spec listing colour hex, padding and states (default, pressed) in the handoff document.
Example 4 — Model answer: Prepare a design handoff for a login screen (theory/structure):
A full answer should list and describe the files and content to hand off:
- Mockups: final artboards for mobile (360×800 dp) and desktop (1366×768 px).
- Flow: clickable prototype link showing successful login, error states and password reset path.
- Component specs: input fields, button, error message — each with measurements, spacing, states and accessibility text labels.
- Style guide tokens: primary colour (#...), secondary, success/error colours, typography scale (e.g., Android H1 = 24 sp, body = 14 sp; iOS H1 = 24 pt, body = 14 pt; Web H1 = 24 px, body = 14 px), spacing scale (4/8/16/24).
- Assets: icons as SVG and PNG at required scales; images optimised and named.
- Interaction notes: button press duration, animation easing, keyboard handling, focus order.
- Accessibility: contrast ratios (WCAG 2.1 AA: ≥4.5:1 for normal text, ≥3:1 for large text ≥18 pt or 14 pt bold), touch target sizes (Android ≥48×48 dp; iOS ≥44×44 pt), alt text or accessible names for images/icons.
Common mistakes
- Using 160 DPI as a universal screen DPI: 160 is Android mdpi baseline for dp conversion, not the physical DPI of every device.
- Not including interaction states or accessibility notes in a handoff (developers need disabled/focused/hover states and ARIA labels).
- Exporting raster icons only at one scale; forgetting SVG/vector for sharp scaling.
- Inconsistent spacing: mixing 4/6/10 instead of a single rhythm (e.g., 8-point system).
- Not annotating typography with font size, line-height and letter-spacing separately.
For your exam
Typical question types:
- Definitions and short notes (define style guide, design system, wireframe).
- Diagram tasks (draw and annotate a component spec or export scale diagram).
- Procedural/step questions (how to prepare a handoff or export assets for multiple densities).
- Numerical conversion (dp ↔ px, DPI and printed size).
- Long answer / design document (prepare content of a handoff for a given screen).
What full-marks answers include:
- Precise definitions (bold a term and explain its role).
- Correct formulas with units and assumptions (e.g., dp→px formula with mdpi baseline stated).
- Clear, labelled diagrams as described in Key ideas.
- Step-by-step export or handoff instructions, naming conventions, and file formats.
- Accessibility and responsiveness notes where relevant.
Quick check
- Define a design system in one sentence.
- Convert 800 px to inches at 200 DPI.
- If a button is 48 dp wide and the device is 320 dpi, what is the width in px? (Use Android baseline 160 dpi.)
Answers: 1) A design system is a versioned collection of reusable UI components, tokens and rules that ensure consistent design across products. 2) 800 px / 200 DPI = 4.0 in. 3) px = 48 × (320 / 160) = 48 × 2 = 96 px.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?