Sidebar Examples

Interactive demonstrations

Sidebar Layout

This example demonstrates optional RSL sidebar patterns using classic float behavior. The first content block flows beside the sidebar; a second block starts below the sidebar and expands to full width (perfect for grids or “magazine” style layouts).

While CSS Grid is the backbone of the RSL layout system, floats are used here intentionally because they solve a very specific, classic layout problem that Grid cannot: allowing content to naturally wrap beside a sidebar and then automatically flow into a full-width section once it clears the sidebar’s height. This is exactly what floats were originally designed for—letting inline content wrap around a fixed block—making them ideal for dynamic CMS-generated pages where sidebar height is unknown and cannot be synced with the main content.

Quick overview:

  • .rsl-sidebar-layout wraps the entire sidebar + content.
  • .rsl-sidebar-left / .rsl-sidebar-right float left or right at a fixed width.
  • .rsl-main-with-sidebar or .rsl-main-with-both holds content between sidebars.
  • .rsl-below-sidebar clears the floats and becomes full width.

New to Sidebar Layouts?

Get up and running in 3 minutes with our Quick Start Guide!

View Quick Start Guide

Download RSL Example Pack

Sidebar Layout API

Sidebar layouts in RSL are built from a small set of utility classes. You combine them to get left, right, or dual sidebars with content that either sits beside the sidebars or clears below them.

.rsl-sidebar-layout
Wrapper for the entire sidebar region. Contains one or more sidebars plus main content.
.rsl-sidebar / .rsl-sidebar-left
Left-aligned sidebar. Floats left at a fixed width with margin on the right.
.rsl-sidebar-right
Right-aligned sidebar. Floats right at a fixed width with margin on the left.
.rsl-main-with-sidebar
Main content that sits beside a single sidebar (left or right).
.rsl-main-with-both
Main content that sits between a left and right sidebar.
.rsl-below-sidebar
Full-width content that starts below all sidebars. Ideal for RSL grids, charts, or additional sections.

Behavior notes:

  • Sidebars use classic floats to let content wrap beside them.
  • .rsl-below-sidebar uses clear: both; to snap to full width under the floats.
  • On small screens (under 768px), all sidebars stack above the content for readability.
  • Inside any content block, you can still use normal RSL grids with .slot-layout and .slot-item.

Sidebar Auto API (data attributes)

If you prefer to avoid manual classes, you can let sidebar.js wire things up for you using data attributes. Mark a wrapper with .rsl-sidebar-auto and a data-sidebar mode, then tag inner elements with data-sidebar-slot.

  • data-sidebar="left" – single left sidebar.
  • data-sidebar="right" – single right sidebar.
  • data-sidebar="both" – left and right sidebars.
  • data-sidebar-slot="sidebar" – generic sidebar when using left/right modes.
  • data-sidebar-slot="left" / "right" – sidebars when using both mode.
  • data-sidebar-slot="main" – main content beside / between sidebars.
  • data-sidebar-slot="below" – full-width content below all sidebars.
Auto Sidebar Example • HTML

Page title

Short intro text goes here.

Lorem ipsum dolor sit amet…

Grid A
Grid B
Grid C

Left Sidebar Demo

Page title

Short intro text goes here.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

More paragraphs…

More paragraphs…

More paragraphs…

Grid A
Grid B
Grid C

Right Sidebar Demo

Page title

Short intro text goes here.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

More paragraphs…

More paragraphs…

Grid A
Grid B
Grid C

Left & Right Sidebar Demo

Analytics overview

This main content is squeezed between the left and right sidebars. As the content grows, it flows naturally until it passes the height of one or both sidebars.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

More paragraphs…

More paragraphs…

Metric A
Metric B
Metric C
Metric D
Code • HTML


Left Sidebar Demo

Page title

Short intro text goes here.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

More paragraphs…

More paragraphs…

More paragraphs…

Grid A
Grid B
Grid C

Right Sidebar Demo

Page title

Short intro text goes here.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

More paragraphs…

More paragraphs…

More paragraphs…

Grid A
Grid B
Grid C

Left & Right Sidebar Demo

Analytics overview

This main content is squeezed between the left and right sidebars. As the content grows, it flows naturally until it passes the height of one or both sidebars.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

More paragraphs…

More paragraphs…

Metric A
Metric B
Metric C
Metric D

Auto Sidebar Demo (data attributes)

Auto-wired layout

This example uses only data attributes. The JavaScript helper adds the correct RSL sidebar classes at runtime, so the layout behaves just like the manual left-sidebar demo above.

You can drop this pattern into a CMS template without worrying about which classes to apply where—just set data-sidebar and the data-sidebar-slot values.

Auto Grid A
Auto Grid B
Auto Grid C

♿ Accessibility Quick Notes