On this page
Application sidebars provide a stable map beside changing content. Their strength is persistence, but that same persistence makes small layout problems visible on every screen. A sidebar should reveal destinations clearly without consuming the space needed to use the application itself.
Set the sidebar's scope and width
Decide whether the sidebar represents the whole product, a workspace, or one section. Mixing all three without clear grouping makes hierarchy difficult to read. Place workspace switching near the top if it changes the meaning of every destination below it, rather than presenting it as another ordinary page link.
Use the CSS Grid Generator to compare a fixed sidebar track with a flexible content track. Try representative widths such as 224, 256, and 288 pixels against your actual labels. These are useful exploration points, not required sizes. The right choice depends on label length, nesting, and the complexity of the adjacent content.
Establish a width budget for the complete shell. A sidebar that looks restrained on a large monitor can leave a data table unusably narrow on a small laptop. The existing guide to responsive container architecture provides useful context for coordinating the shell and page interior.
Group destinations without overdecorating
Use section grouping to reveal related destinations. A short heading and extra space can separate account management from reporting without surrounding each group in its own card. Too many containers create competing boundaries and make the sidebar feel denser than it is.
Keep destination rows consistent in height and alignment. Icons should occupy a stable slot so labels share a clear starting edge. If an icon does not help recognition, omitting it can be better than attaching an arbitrary symbol to every page. Avoid letting badges push the text into inconsistent positions.
Make the current destination visible with more than a tiny color shift. A background shape plus a marker or stronger label weight can establish the selected row. If parent sections also receive emphasis, ensure the parent and current page do not look like two independent selections.
For nested navigation, use indentation sparingly. Deep indentation rapidly consumes label space. When a hierarchy requires several levels, consider showing the current section's children rather than rendering the entire product tree at once. This is a layout decision about what fits coherently, not a reason to conceal important destinations without an alternative.
Build a shell that allows content to shrink
A common implementation problem is a flexible content track that refuses to become smaller than its contents. Explicitly allowing the main region to shrink helps keep a wide child, such as a table, from stretching the entire shell.
.app-shell {
display: grid;
grid-template-columns: 16rem minmax(0, 1fr);
min-block-size: 100dvh;
}
.sidebar {
padding: 1rem .75rem;
border-inline-end: 1px solid #d7dde5;
}
.main-content { min-inline-size: 0; }
.sidebar-link {
display: flex;
align-items: center;
gap: .75rem;
padding: .75rem;
border-radius: .5rem;
}
@media (max-width: 52rem) {
.app-shell { grid-template-columns: minmax(0, 1fr); }
.sidebar { display: none; }
}The compact rule only illustrates the shell change. A real product still needs a visible trigger and an operable replacement navigation panel; hiding the sidebar alone removes functionality. Use MDN's grid documentation to understand track sizing and overflow.
Keep the main content's internal spacing separate from sidebar padding. The two regions have different density needs, and sharing one global padding value often produces a cramped page or an excessively loose navigation rail.
Treat collapsed rails as a separate mode
A collapsed rail is not simply a sidebar with its text clipped. It needs recognizable controls, accessible names, clear selection, and a way to expand. If several destinations use similar icons, the rail may save width while substantially reducing clarity.
Test the collapsed mode with people who do not know the icon set. Tooltips can supplement the interface, but they should not become the only practical way to discover every destination. Keep the expansion control in a predictable location and distinguish it from a navigation item.
Do not preserve every badge in a narrow rail. A large count beside a small icon can dominate the entire control. Consider whether an indicator is necessary and whether a quieter dot communicates enough until expansion. Never hide a meaningful count if the task depends on that exact value.
For expandable groups, follow a consistent visual rule for chevrons and child rows. The WAI disclosure pattern provides a behavioral foundation. Avoid giving a navigation sidebar application-menu semantics merely because it looks like a vertical menu.
Review height, overflow, and realistic states
Use a short viewport test as well as a narrow one. Workspace controls, a long destination list, and account actions may not all fit vertically. Decide which region scrolls, and make sure the final destination remains reachable without covering it with a fixed account footer.
Populate badges with zero, single-digit, and large counts. Show a long workspace name, a translated destination, and an active nested page. These examples expose alignment problems that identical placeholder labels conceal. Keep selected and hover styling distinct enough to understand together.
Review divider, text, and selected-state colors with the Contrast Checker. Consult the WCAG quick reference for relevant interaction and visibility requirements rather than assuming a visually tidy sidebar is automatically accessible.
Finish with a small specification covering expanded width, compact behavior, nested indentation, overflow, and selection rules. Include a screenshot with the longest expected labels. A sidebar that works only with the shortest names is not ready to become the persistent frame around every page in the product.
Compare the sidebar with several real destination pages rather than one empty dashboard. A wide editing canvas, a dense settings form, and a short informational page expose different balance problems. Do not let a decorative navigation width dictate a permanently cramped work area. If users can change the sidebar mode, retain a clear expansion affordance after navigation and reload. Also inspect the transition between an expanded group and its neighboring groups: extra child rows should push subsequent content down naturally, not overlap account controls or disappear beneath an artificial fixed height.
Key takeaways
- Define the navigation scope before choosing a width.
- Group related destinations with restrained visual structure.
- Make the current page clear without confusing parent emphasis.
- Treat collapsed rails and narrow-screen panels as complete modes.
- Test long labels, large badges, and limited viewport height.
Reach designers & developers at work
Put your product next to the tools people use every day. One sponsor per placement, no tracking pixels.
Become a sponsor