agentleFS
KinwiseNZ-DevOpsKinwiseNZ-DevOps/ui-ux-designer/skills/adaptive-layout-and-spacing/SKILL.md

adaptive-layout-and-spacing

Skill0 starsChanged 22 days agoMITView on GitHub

Use when laying out a screen, setting spacing and grids, handling notches and safe areas, adapting a phone design to tablet, foldable or desktop, choosing breakpoints or size classes, or fixing a layout that breaks with large text or rotation. Covers hierarchy, grouping, safe areas, edge-to-edge, size classes and reflow. Do not use for navigation structure (navigation-and-flows), colour and type (visual-design-system) or writing layout code.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep functionality the same across sizes.

    line 19
  2. Distinctive:

    Group and align: Use space, containers or separators for related items.

    line 38
  3. Distinctive:

    Place for the thumb: Put frequent actions in the lower middle.

    line 39
  4. Distinctive:

    Adapt by size class: Use size-classes.md: compact (one column, bottom bar), medium (rail or two panes), expanded and larger (list-detail, …

    line 41
  5. Distinctive:

    Verify: Test rotation, split screen, largest text size, 320 CSS px width, and with the keyboard open.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adaptive Layout and Spacing

Stance: frozen are the information hierarchy, the full set of functions on every size, and respect for safe areas. Flexible are columns, panes and how much is shown at once.

Hard rules

  • Order by importance: key content at the top and leading edge. Mechanism: people read top to bottom from the leading side, so late placement means missed content.
  • Keep functionality the same across sizes; change only how much is visible. Mechanism: a feature that exists on desktop but not on phone splits support and trust (Apple HIG).
  • Design for the window, not the device. Mechanism: split screen, desktop windows, rotation and folding change available space at any time; use size classes, not device names (Android).
  • Respect safe areas and system bars. Mechanism: content under the notch, status bar or gesture bar is unreadable or untappable. Inset content, keep targets out of the gesture inset.
  • Layout must survive large text and 320 CSS px width without two-direction scrolling. Mechanism: WCAG 1.4.10 reflow; fixed-height boxes clip enlarged text.
  • Cap line length on wide screens. Mechanism: lines across a desktop are hard to track; use a readable text width.
  • Act only on what the user asked. Before answering or changing anything, open the relevant files and check what is already done; report only what you checked, never guess, and do not redo finished work. Reason: guesses and repeated work waste the user's credit.

Gate

SituationAction
Small spacing or alignment tweakFix in place, no redesign
Layout fails at one size classFix that class, check the others
New screenPhone layout first, then medium and expanded
Request to hide features on small screensDecline; move them behind progressive disclosure instead

Steps

  1. Rank content. List the elements on the screen and order by importance. Mark the primary action.
  2. Group and align. Use space, containers or separators for related items. Align edges; indent only to show hierarchy. Use one spacing scale (multiples of 4 or 8) throughout.
  3. Place for the thumb. Put frequent actions in the lower middle; keep destructive actions away from easy-hit spots. Treat reach as a heuristic: grips vary.
  4. Apply safe areas. Pad for status bar, notch, home indicator, tab bar and keyboard. Draw backgrounds edge to edge, keep controls inside.
  5. Adapt by size class. Use size-classes.md: compact (one column, bottom bar), medium (rail or two panes), expanded and larger (list-detail, sidebar, multi-column). Check height too for landscape phones and folded postures.
  6. Add desktop behaviour. Pointer hover as an extra, visible focus, keyboard shortcuts as extras, resizable windows.
  7. Verify. Test rotation, split screen, largest text size, 320 CSS px width, and with the keyboard open.

Checklist (copy into the reply and tick as you go)

- [ ] Content ranked; primary action obvious
- [ ] One spacing scale used
- [ ] Safe areas and keyboard handled
- [ ] Compact, medium and expanded layouts described
- [ ] Same functions at every size
- [ ] Large text and 320 CSS px tested or listed as untested

Examples

Example 1: phone to tablet User says: "Our order list looks stretched on iPad." Actions: identify the window width class; keep the list as the leading pane; add a detail pane on the trailing side; keep the same actions; cap text width. Result: a two-pane list-detail layout at medium width and above, one column on phones.

Example 2: hiding features User says: "Remove the filters on mobile, nobody uses them there." Actions: ask for evidence; explain that removal splits behaviour across sizes; propose filters behind a button opening a sheet. Result: filters remain available, with the screen kept clean.

Common issues

  • Content hidden behind the bottom bar. Cause: no bottom inset. Fix: pad scrollable content by the bar height plus the safe area.
  • Fields hidden by the keyboard. Cause: layout ignores keyboard insets. Fix: scroll the focused field into view and resize the layout.
  • Clipped labels at large text. Cause: fixed heights. Fix: let rows grow, wrap text, test at the largest size.

References

  • size-classes.md: breakpoints, layout per class and desktop notes.

Next

navigation-and-flows for how navigation changes by size; accessible-design for targets and text scaling.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.