Skip to content
IndexRequest a UIAboutContact

Sticky Sidebar Article Layout

A long article with a sidebar card that stays in view while the text scrolls, and a switch to compare without sticky.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI IMAGE OR VIDEO TOOL
Clean wireframe of a long-form article page with a wide main column of text lines and a narrow right sidebar card titled In this article with four links, shown in three vertical positions as the page scrolls with the sidebar staying pinned near the top while the text moves up, small arrows indicating scroll direction, thin outlines and soft grey fills, light theme. Negative: gradients, clutter, text errors. Reduced motion: static diagram.

About this pattern

Definition

On long pages a side panel such as a summary, table of contents or call to action should stay visible while the reader scrolls. position: sticky does this without JavaScript: the panel flows with the page until it reaches its top offset, then holds, and stops again when its column ends.

When to use it

  • Use a two-column grid; give the aside align-self: start so it does not stretch the full height.
  • Set position: sticky and top: with space for any fixed header.
  • Make sure no ancestor has overflow hidden that breaks stickiness.
  • Collapse to one column on small screens and place the aside after the article.

What the controls do

  • Scroll the article area; switch Sticky on or off.

Motion & timing

  • Nothing animates by itself.
  • Reduced motion: no animation is involved.

Tips & variations

  • A sticky panel taller than the viewport becomes unreachable; keep it short or scrollable.
  • Keep the reading order logical in the HTML.

Code of this live preview

HTML
<div class="bx"><div class="sc" id="sc"><div class="gd"><article><h4>A long read</h4><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></article><aside id="as"><b>In this article</b><span>Intro</span><span>Method</span><span>Results</span><span>Notes</span></aside></div></div><label class="sw"><input id="st" type="checkbox" checked> Sticky sidebar</label></div>

Related patterns

Holy Grail Three-column Layout

↗
Holy Grail Three-column LayoutLayout Structures

Scrollspy Table of Contents

↗
Scrollspy Table of ContentsNavigation

Sticky Footer Layout

↗
Sticky Footer LayoutLayout & Scrolling