Application · lesson 11 of 12 · Personalization And Preference

User-controlled density

Underlying principle: Preferences help a recurring task when the saved choice is visible, reversible, and scoped to the right person and device. Defaults should preserve a clear starting point.

Use user-controlled density when different users or moments call for scanning more items versus reading with more breathing room on the same surface.

Start with the decision

Does this fit your task?

Users need to switch between scanning many records and reading or editing with more space.

Review the boundary: Compare the task with the alternatives in the decision section.

Review the decision →
Study the interaction

Follow the task before choosing the component

Preferences help a recurring task when the saved choice is visible, reversible, and scoped to the right person and device. Defaults should preserve a clear starting point.

01 / Recognize the need

What the person is doing

Users scan tables, queues, lists, cards, logs, inboxes, dashboards, or admin records with different preferences, devices, zoom levels, and task urgency.

02 / Design the response

What the interface must communicate

Use user-controlled density when different users or moments call for scanning more items versus reading with more breathing room on the same surface.

Default density state

03 / Judge the outcome

What to look for

What exactly changes when density changes: row height, padding, gaps, controls, or content?

The control announces the selected density and scope before and after change.

Decision first

Choose this pattern when the problem matches

Use when

  • Users need to switch between scanning many records and reading or editing with more space.
  • The product can preserve state and accessibility guarantees while density changes.

Avoid when

  • Changing density would hide required information, reduce targets below usable sizes, or break focus.
  • The user needs to save filters, columns, sort, or grouping as a view rather than adjust spacing.
  • A responsive layout or text-size control is the real need.
  • A regulated or high-risk task requires fixed spacing for review accuracy.

Problem it prevents

Users scan tables, queues, lists, cards, logs, inboxes, dashboards, or admin records with different preferences, devices, zoom levels, and task urgency.

Test the behavior

Try strong and weak versions of the interaction

Open the working example, try its controls, and compare the behavior against the decision guidance.

In the lab you can
  • switch between strong UI, weak UI, strong UX, and weak UX;
  • trigger required, empty, loading, error, and recovery states;
  • inspect keyboard and accessibility expectations beside the demo.
Launch User-controlled density in the lab
Pattern anatomy

What a strong implementation has to make clear

User need

Users scan tables, queues, lists, cards, logs, inboxes, dashboards, or admin records with different preferences, devices, zoom levels, and task urgency.

Pattern promise

Use user-controlled density when different users or moments call for scanning more items versus reading with more breathing room on the same surface.

Required state

Default density state

Failure to inspect

Compact density hides labels, status, validation, or row actions.

Access contract

Expose selected density, scope, and reset state as text.

Quality bar

The difference between expert and weak execution

Strong implementation

Specific, visible, recoverable

  • A case queue toolbar lets users switch Comfortable, Standard, and Compact row density, shows This table only, preserves selected rows, and keeps row actions readable.
  • A workspace setting lets each user choose default list density for their account while previewing row height and resetting to organization default.
  • A data grid density menu updates header height, row height, checkbox alignment, batch action height, and open detail rows together.
  • A support agent switches a queue to Compact to scan SLA risk, keeps the focused row and filters intact, then returns to Comfortable before reading long notes.
Weak implementation

Vague, hidden, hard to recover from

  • A compact toggle removes secondary labels and status chips instead of only reducing spacing.
  • Changing density resets filters, selected rows, open rows, and unsaved edits.
  • A user shrinks density and accidentally clicks the wrong row action because target sizes collapsed.
  • A saved view named Compact changes both spacing and filters, making users distrust view switching.
UI guidance
  • Render density as a visible segmented control, menu, or setting with named choices such as Comfortable, Standard, Compact, and Spacious, plus scope, preview, and reset feedback.
  • Keep content, order, filters, selection, edits, and row identity stable when density changes; only spacing, row height, padding, and related control sizing should change.
UX guidance
  • Use user-controlled density when different users or moments call for scanning more items versus reading with more breathing room on the same surface.
  • Protect readability and accessibility by maintaining labels, status text, focus indicators, row actions, touch targets, text scaling, and keyboard navigation across every density option.
Implementation contract

What the implementation must handle

States

  • Default density state
  • Comfortable or spacious density state
  • Standard density state
  • Compact density state

Interaction

  • The control announces the selected density and scope before and after change.
  • Persisting density is a distinct action when the scope is broader than the current surface.
  • Reset restores only the density value for the named scope.
  • Managed or inherited density values explain who owns them and where to request a change.

Accessibility

  • Expose selected density, scope, and reset state as text.
  • Keep focus indicators, labels, validation, status, row actions, and selection affordances visible at every density.
  • Maintain keyboard navigation order and focus restoration when density changes.
  • Respect browser zoom, OS text size, touch target needs, and high-contrast modes.

Review

  • What exactly changes when density changes: row height, padding, gaps, controls, or content?
  • What stays invariant: data, filters, sort, selection, focus, edits, row identity, and open details?
  • Is this density preference temporary, personal, device-specific, workspace-scoped, or managed by policy?
  • Do compact and spacious modes still meet keyboard, touch, zoom, localization, and screen-reader needs?
Evidence trail

Source-backed claims behind this guidance

Cloudscape content density

Cloudscape Design System - checked

Cloudscape documents comfortable and compact content density modes.

Full agent/debug reference

Problem Context

  • Users scan tables, queues, lists, cards, logs, inboxes, dashboards, or admin records with different preferences, devices, zoom levels, and task urgency.
  • The same surface may need compact scanning for triage and comfortable spacing for review, editing, touch, or accessibility.
  • Density may be temporary for one table, persisted for one user, inherited from a workspace setting, or unavailable on narrow screens.
  • Changing density can affect row height, header height, batch action bars, checkboxes, menus, inline validation, focus rings, and open detail rows.

Selection Rules

  • Choose user-controlled density when users need to decide how much vertical or horizontal spacing a surface uses without changing which data is included.
  • Use settings management when density is part of a broader durable configuration area rather than the primary pattern.
  • Use saved view when users are saving filters, columns, sort, grouping, or dataset scope rather than spacing alone.
  • Use data grid when the hard problem is managed cell focus, editing, selection, or row-and-column semantics.
  • Use responsive layout when screen size requires a different structure; density should not be the only mobile adaptation.
  • Offer compact density only where labels, icons, focus rings, row actions, status, and targets remain perceivable and operable.
  • Show whether the density change is temporary, this surface only, this device, account-wide, workspace-wide, or organization-managed.
  • Preserve current filters, sort, selected rows, expanded rows, edited values, scroll anchor, and focused item across density changes.
  • Provide reset or system default recovery and avoid coupling density reset with unrelated layout, theme, saved view, or filter resets.
  • Disable or adapt density choices when content length, touch mode, high zoom, screen width, or accessibility settings make compact spacing unsafe.

Required States

  • Default density state
  • Comfortable or spacious density state
  • Standard density state
  • Compact density state
  • Preview-before-save state
  • Temporary density state for current surface
  • Saved personal density state
  • Workspace or organization-managed density state
  • Reset to system default state
  • Unavailable or unsafe compact state
  • Mobile or narrow-screen density fallback state
  • Focus, selection, expanded-row, and edited-value preservation state

Interaction Contract

  • Changing density updates row height, padding, and compatible controls without reordering data, changing filters, clearing selection, or discarding edits.
  • The control announces the selected density and scope before and after change.
  • Persisting density is a distinct action when the scope is broader than the current surface.
  • Reset restores only the density value for the named scope.
  • Managed or inherited density values explain who owns them and where to request a change.
  • Compact density keeps required labels, status, focus indicators, validation messages, and row actions available.

Implementation Checklist

  • Define density tokens for row height, header height, padding, gaps, icon placement, batch actions, expanded content, and touch targets.
  • Decide supported scopes: current table, current product area, device, account, workspace, or organization policy.
  • Keep density state separate from saved view state, filters, sort, column visibility, layout arrangement, zoom, and text-size settings.
  • Preserve focus, scroll anchor, selected rows, expanded rows, drafts, and validation when density changes.
  • Provide preview, save, reset, inherited, unavailable, and unsafe-compact states.
  • Test keyboard use, screen readers, high zoom, touch, long labels, localized strings, open row details, row actions, validation messages, and virtualized rows in every density.

Common Generated-UI Mistakes

  • Treating density as a way to remove metadata, labels, helper text, or status instead of changing spacing.
  • Making compact mode the only way to use the product efficiently.
  • Saving personal density as a team or organization setting without consent.
  • Coupling density to saved filters, columns, theme, layout arrangement, or zoom.
  • Shrinking hit targets, focus outlines, or row actions below usable sizes.
  • Resetting table state or losing edits when density changes.
  • Offering compact density on mobile while forcing horizontal scrolling and hidden row identity.

Critique Questions

  • What exactly changes when density changes: row height, padding, gaps, controls, or content?
  • What stays invariant: data, filters, sort, selection, focus, edits, row identity, and open details?
  • Is this density preference temporary, personal, device-specific, workspace-scoped, or managed by policy?
  • Can users preview, save, reset, and recover the density choice without affecting saved views or filters?
  • Do compact and spacious modes still meet keyboard, touch, zoom, localization, and screen-reader needs?
  • Should the narrow-screen experience use a different layout instead of exposing desktop compact density?
Accessibility
  • Expose selected density, scope, and reset state as text.
  • Keep focus indicators, labels, validation, status, row actions, and selection affordances visible at every density.
  • Do not rely on visual spacing alone to indicate grouping; preserve headings, borders, or labels when spacing compresses.
  • Maintain keyboard navigation order and focus restoration when density changes.
  • Respect browser zoom, OS text size, touch target needs, and high-contrast modes.
  • Announce density changes through a stable status region when the visual layout shifts.
Keyboard Behavior
  • Tab reaches the density control, preview or save controls, reset control, and returns to the affected surface without focus loss.
  • Arrow keys may move within a segmented density control when semantic roles support it.
  • Enter or Space applies the selected density according to native control behavior.
  • After applying density, focus remains on the invoking control or returns to the previously focused row or item according to the stated contract.
  • Escape closes density menus and returns focus to the density trigger.
Variants
  • Table density selector
  • Grid density menu
  • List compactness toggle
  • Card spacing preference
  • Comfortable reading mode
  • Compact scanning mode
  • Spacious touch mode
  • Personal density setting
  • Workspace-managed density
  • Temporary density preview

Verification

Source trail checked:

Saved items