Skip to content

Layout

Border radius

The rounding on a corner. An inner element inside a rounded container needs a smaller radius, calculated as outer radius minus padding. Matching both creates a visible gap.

56px
56px / 56px
Padding20px

The outer corner stays 56px. Subtracting padding removes the corner bulge so both curves stay concentric.

Gap

Space between flex or grid children, set on the parent. Unlike margin, it leaves no trailing space after the last item.

1
2
3
margin-inline-end: 14px
Space14px

Compare child margin with parent gap. The dashed highlight shows the extra trailing margin after item 3.

Negative space

The empty area around and between elements. It defines shape, creates breathing room, and guides the eye. Crowding elements together removes clarity, it doesn’t add information.

UpdateRelease notes

Same content; only the empty space around and between elements changes.

Breathing room2px

Increase padding and spacing. Nothing is added, yet the card becomes easier to scan.

Flexbox

A CSS layout model for arranging elements in a row or column. Controls direction, alignment, spacing, and how items grow or shrink to fill available space. The foundation of most modern UI layout.

AB · 1C · 1
→ row · B:C = 1:1
Item B grow1

Switch between row and column. Item C stays at grow 1 so each step changes how B and C share free space.

Auto layout

Figma’s implementation of flexbox: elements that space themselves, resize with their content, and respond to direction and alignment rules.

TagEdit
Hug · Hug
Items2

The frame hugs its items and updates its live dimensions when direction or count changes.

Layout shift

When elements move unexpectedly as a page loads: images popping in, fonts swapping, content reordering. Avoided by reserving space before content loads and using size-matched font fallbacks.

Article title

Watch whether this text and button jump down.

Read
Reserved 16:9 slot

Load the image in both modes. Reserving space stops the text and button below from jumping.

Overflow

What happens when content is larger than its container. Hidden clips silently. Scroll adds a scrollbar. Auto only shows one when needed. Hidden also silently breaks sticky positioning on child elements.

Sticky positioning

An element that scrolls normally until it hits a threshold, then fixes in place. Requires a parent that is not set to overflow hidden, which silently breaks it.

Aspect ratio

The proportional relationship between width and height. Setting it on images and embeds lets the browser reserve the right space before the content loads, preventing layout shift.

Viewport units

Units relative to the browser window. vw and vh are the classics. dvh accounts for the mobile browser chrome that shows and hides on scroll. Using vh for full-screen mobile layouts often causes overflow because of this.

Safe area

The part of a screen not obscured by notches or home indicators. Fixed bottom elements need to account for this or they sit underneath the home indicator.

Max-width

A cap on how wide a container gets. Without one, text lines stretch to unreadable lengths on wide screens.

Breakpoint

The point at which a layout changes to suit a different screen size. Best set where the content actually breaks, not at assumed device widths.

Responsive

A design that adapts to different screen sizes rather than being fixed. Achieved through fluid layouts, flexible images, and breakpoints. The baseline expectation for anything on the web.

Grid

A system of columns that organises layout. 12 columns is conventional. 8 often works better for simpler layouts.

Asymmetry

A layout where columns or elements are intentionally unequal. Creates tension and visual interest. Symmetry is stable but rarely interesting.

Baseline grid

A horizontal rhythm built from the line-height of body text. Creates consistency in editorial layouts. Often overkill in product UI.

Z-index

The stacking order of elements on the same plane. Modals, tooltips, and dropdowns need explicit z-index values or they clip behind things they should sit above.