Overview
Side info sits in a section whose body is a row: the content in .nds-info-content, and the column in aside.nds-sideinfo. The aside sets the width, the place and the sticky behavior. It has no look of its own: the cards inside it have the look.
The preview shows it in a frame of its own, with a hero above it, so the column can move up beside the page title. A placeholder stands in for the card in the column: the Related templates show real content.
Pick another component when:
- the links go to the pages of one part of the site: Side Menu
- the reader opens the extra information and closes it again: Panels
- the facts belong in the content, with no column: Definition List
The side info is the side column of a standard page. The other page columns are on Page Layout.
Markup
Parts
| Part | Holds | Required |
|---|---|---|
section.nds-hero-section.nds-sub |
The page hero. With nds-aside, the column moves up beside its title. See Hero |
No |
.nds-content-layout.nds-has-sideinfo |
The page content. nds-has-sideinfo sets the section padding of a page with a side column. See Page Layout |
Yes |
section.nds-sideinfo-section |
A .nds-section-body with the content and the column |
Yes |
.nds-info-content |
The content of the section, usually an article |
Yes |
aside.nds-sideinfo |
The column. Give it an aria-label that names what it holds |
Yes |
| The block | A direct child of the aside, such as a definition list, a table of contents, a stepper or a group. nds-card on it is optional and changes only the look. The aside can hold several. For several blocks in one card, use a div with nds-card that holds groups |
Yes |
.nds-sideinfo-group |
One block with a title: a span.nds-sideinfo-title, then its definition list or links. It sits in the aside or in a card |
No |
Variants
The width is not in the builder: see --nds-sideinfo-width in the API.
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Sticky (any) | Desktop (default) (hint: At 960px and wider, the column stays in view while the content scrolls) | .nds-sticky |
.nds-sideinfo |
At 960px and wider, the column stays in view below the main navigation while the content scrolls. Turn it off for a short page |
| Sticky (any) | Strip on small screens (hint: Below 960px, the column stays in view as a strip across the screen) | .nds-sticky-md |
.nds-sideinfo.nds-top |
Below 960px, the column stays in view as a strip across the screen, below the main navigation. Needs the column above the content. For a short column, such as a progress dial |
| Small screens | Above the content (default) | .nds-top |
.nds-sideinfo |
Below 960px, the column moves above the content |
| Small screens | Under the content | — | .nds-sideinfo:not(.nds-reverse) |
Below 960px, the column stays under the content, and scrolls away with it. It cannot be sticky there. Not with Start side |
| Start side | Start side (hint: The column moves to the start side of the row) (limit: 1 position) | .nds-reverse |
.nds-sideinfo |
The column moves to the start side of the row, and above the content below 960px. For a table of contents, write the aside first in the markup instead. Not with Beside the title |
| Beside the title | Beside the title (hint: On desktops, the column moves up beside the page title) (limit: 1 position) | .nds-aside |
.nds-hero-section.nds-sub |
At 960px and wider, the column moves up beside the page title, on the end side. For a column about the whole page, in the first section. Not with Start side |
| More cards | More cards (hint: A second card under the first) | canon #sideinfo-more |
.nds-sideinfo |
A second card in the column, under the first |
Behavior
Sticky Column
nds-sticky on the aside keeps the column in view below the main navigation while the content scrolls. While the column is taller than the screen, the script removes nds-sticky, so the reader can scroll to its end. It adds the class back when the column fits again. Below 960px, nds-sticky has no effect.
Sticky on Small Screens
nds-sticky-md keeps the column in view below 960px, and nds-sticky-sm below 600px only. The column then spans the screen below the main navigation, with a shadow under it. Each one works alone or with nds-sticky. Write nds-top with it: under the content, the column is the last item in its section, so it never sticks. Like nds-sticky, the script removes it while the column is taller than the screen.
Column Order
The aside shows where it is in the markup: after the content, it is on the end side and under the content below 960px. nds-reverse moves it to the start side, and above the content below 960px. nds-top moves it above the content below 960px only. For navigation such as a table of contents, write the aside first instead: it is then on the start side and on top, and keyboard users reach it first.
Beside the Title
nds-aside on the sub hero narrows the hero text by the column width. At 960px and wider, the script then measures the hero and moves the column up beside the title. It measures again when the screen size changes, when the hero changes size, and after the fonts and images load. Below 960px, the column stays in its section. It works only with the column on the end side, so do not write it with nds-reverse.
Built-in Features
-
Auto Start
The script starts each
.nds-sideinfoon the page when it loads. -
Responsive Stack
Below 960px, the row becomes a column, and the side info takes the full width.
-
Width by Content
The column is 400px wide, or 300px when it holds a table of contents.
-
Stacked Cards
Several cards in the column stack, with
--nds-sideinfo-gapbetween them. -
Column Card
The card in the column fills its width, with the menu background and a larger padding.
-
Compact Facts
A definition list in the column keeps its own size: large by default, or the size class on the list.
-
Section Gaps
In an
articlein the content, each.nds-section-titleafter the first gets space above it.
Best Practices
- Put information about the section’s content in the column: facts, progress, a table of contents, or links to related pages such as related news. Do not put ads in it.
- Put
nds-cardon the card inside theaside, never on theaside. - Give each topic its own block. Use one card with groups for short blocks that belong together, such as contact numbers.
- Keep the column short. Use a definition list for facts and a stepper for progress, not long paragraphs.
- Make the column sticky beside long content. On a short page, the reader sees all of it without help.
- Use Beside the title only when the column is about the whole page, and only in the first section.
- Give the
asideanaria-labelthat names what it holds, such as “Service information”.
API
Other Classes
| Class | Element | Effect |
|---|---|---|
nds-sticky-sm |
aside.nds-sideinfo.nds-top |
Keeps the column in view below 600px only, as a strip across the screen. Tablets scroll it |
CSS Custom Properties
| Property | Default | Controls |
|---|---|---|
--nds-sideinfo-width |
None | The width of the column at 960px and wider. Without it, the column is 400px, or 300px when it holds a table of contents. Set it in the style of one aside, or on :root for every column. With Beside the title, set it on :root: the hero reads it from there |
--nds-sideinfo-gap |
var(--spacing-4xl) |
The space between the cards in the column. Set it on the aside, or on :root for every column |
--nds-sideinfo-top-offset |
0px |
Space above the column, at 960px and wider: it adds to the sticky top, and to the move beside the title. Set it in the style attribute of the aside |
--nds-sideinfo-top |
None | The distance from the section to the hero’s title, for Beside the title. The script writes it on the aside at 960px and wider. Until then, the CSS uses -180px. Do not set it |
JavaScript
| Method | Effect |
|---|---|
NDS.Sideinfo.init() |
Starts each .nds-sideinfo on the page that has not started. It runs on page load |
NDS.Sideinfo.create(el) |
Starts one column and returns its instance, or the instance it already has. Returns null when the column has no parent element. Call it once for each column |
NDS.Sideinfo.destroy(el) |
Stops one column: it removes the listeners and --nds-sideinfo-top, and adds back the sticky classes the markup had. NDS.init.destroy() calls it for each column in the element it releases |
The side info fires no events.
The full API is in the banner of _js/nds-sideinfo.js.