Skip to content

Bricks / Panels

css/modules/bricks/_panels.scss

The panel is the data surface: a KPI, a chart, a status, settings — content a system produced and a reader scans. A card is for narrative content; the rule for choosing between them is on the Building Blocks page.

A panel is a block with inner padding — 16px on every width. It paints no background and sets no text colour, so it works on any surface: the page, a card, a dark band. For the same reason it sets no --surface-current: the surface behind it passes through, and a chart in it (RareCharts 0.9.8_7 and later) paints its label plates with that surface (Surfaces). Blocks that hang into the page margin (pre, blockquote, .lead, the caption widths) stay inside it.

.panel.panel--bordered

Modifiers

.panel--bordered
The frame: a 1px border in --border-color with small rounded corners.
.panel--flush
No inner padding. For a panel docked inside another panel or a grid cell that already has its own.
Outer panel

A panel that hangs into the page margin — with .text-content-caption, .full-width-caption or .card-caption, as the outer panel above — steps its content back in by the same outdent: 32px on the side it hangs, so its text stays on the edge of the text column. No modifier is needed; the caption class is the cue. A panel grid or a panel row with a caption width steps in every cell the same way, on both sides: a panel, a card or a row cell takes 32px each side, so the first cell's text starts on the edge of the text column and the other cells match it. On a phone and on paper every such cell takes 16px each side, a card cell included; where the outdent is contained (in a card, a panel, a collapsible) a cell keeps its own padding; a .panel--flush panel stays flush.

Three optional parts give the panel a predictable frame. .panel__header lays out a title and its meta on one baseline, with a divider below; a heading inside it drops its own margins. A lone title spans the header, so .center on the panel centres it too. .panel__body takes the free height, so the footers of panels in one row line up. .panel__footer holds the source or a timestamp in small muted text, with a divider above. A panel with any of the three becomes a flex column; put loose text in the body, or it splits into one line per run.

Revenue
Q3 2026

$2.84M

<div class="panel panel--bordered">
    <div class="panel__header"><h4>Revenue</h4><span class="note">Q3 2026</span></div>
    <div class="panel__body">…</div>
    <div class="panel__footer">Source: internal accounting</div>
</div>

Panel grid

.panel-grid arranges panels in as many columns as fit, each at least --panel-grid-min wide (14rem by default), and one column on a narrow screen. The panels of a row share its height. A cell may shrink below its content, so a chart in it redraws narrower instead of overflowing the grid.

Orders
1,284
Returns
37
Uptime
99.98%
<div class="panel-grid">
    <div class="panel center panel--bordered">
        <div class="panel__header"><h5>Orders</h5></div>
        <div class="panel__body stat"><div class="stat__value">1,284</div></div>
        <div class="panel__footer">Today</div>
    </div>
    …
</div>

To change how wide a column may get before the grid adds another, set --panel-grid-min on the grid: style="--panel-grid-min: 12rem" fits more, narrower panels in a row; a larger value fits fewer, wider ones.

Panel row

.panel__row is a bordered strip of cells side by side, divided by lines: KPI figures under a chart, a row of gauges. Each .panel__row-item takes an equal share and centres its text. It works inside a panel or on its own. On a phone a long row scrolls sideways inside its own border instead of widening the page. For KPI figures, make the cells stats.

OPEN
$184.62
HIGH
$188.13
LOW
$185.23
VOLUME
95.4M
<div class="panel__row">
    <div class="panel__row-item stat">
        <div class="stat__label">OPEN</div>
        <div class="stat__value">$184.62</div>
    </div>
    …
</div>

For KPI figures, put .stat on the row's cells, or a stat inside a cell. On a phone a long row scrolls inside its own border, and each figure stays on one line. A value never wraps, not even at a space (95.4 M, +1.23 (0.76%)): in a box narrower than the figure, a row scrolls and a tile lets it overflow, rather than split it into what reads as two numbers.

Stacking mode

.panel__row--stack keeps the cells side by side from tablet width up and puts them one under another on a phone; the dividers turn with them. Use it for cells that must not shrink into a scrolling strip, such as charts. .panel__row--text-start aligns the cells' text to the start instead of the centre, so a chart's title in a cell reads like every other chart's.

Goal progress
Budget
Disk usage
<div class="panel__row panel__row--stack panel__row--text-start">
    <div class="panel__row-item"><div id="gauge-1"></div></div>
    <div class="panel__row-item"><div id="gauge-2"></div></div>
</div>

Stats

css/modules/bricks/_stats.scss

A stat is a KPI figure: a short label over a value, read at a glance and compared along a row. .stat sets the label small and muted and the value bold, with tabular numerals: every digit takes the same width, so figures in a row line up digit by digit and a live value does not shift sideways as it updates. In a stat taller than its content, a tile in a panel grid or a cell of a panel row, the value sits at the bottom, so the figures of a row line up when one label wraps.

Revenue, Q3
$2,840,112
<div class="panel panel--bordered stat">
    <div class="stat__label">Revenue, Q3</div>
    <div class="stat__value">$2,840,112</div>
</div>

The label and the value are direct children of the stat. A stat sets no surface, padding or alignment: it takes them from where it sits. On a panel it is the panel itself (class="panel stat"), or the body of a panel with a header and a footer (class="panel__body stat", as in the panel grid), and reads from the start; as the cells of a panel row it is centred and padded by the row. It works on its own too, or on a card.

Direction

.stat--delta-up and .stat--delta-down mark a change. An arrow before the value takes the role colour, --positive up and --negative down; the figure keeps the text colour, because the semantic colours are signal colours, not text colours. Screen readers do not announce the arrow, so write the sign in the figure: the direction is in the words too.

Orders, week on week
+12.4%
Returns, week on week
−3.1%

The arrow is drawn in --stat-delta-color. Where a rise is bad news, as with costs or errors, set it on the stat:

<div class="stat stat--delta-up"
     style="--stat-delta-color: var(--negative)">
    <div class="stat__label">Support tickets</div>
    <div class="stat__value">+18%</div>
</div>

Emphasis

.stat--signal sets the value in --signal: a figure that asks for attention, such as a threshold crossed. Let the label say why. The value is bold, so it reads as large text, which the blue meets on the light page and on a dark card.

Error rate, over the 1% limit
1.8%
Error rate, over the 1% limit
1.8%

Chart frames

A chart's frame is a panel on the chart element itself — RareCharts draws into the element you give it and calls it the card. The chart keeps its own layout, clipping and spacing; the panel adds the padding and the frame, and the chart's height includes them. When a page composes more around a chart — a quote header, a row of figures — the panel wraps them all and the chart inside takes no frame of its own. Two places take no frame at all: a chart in a sidenote, which illustrates the text from the margin, and a chart in a panel row cell, which the row already frames.

Until RareCharts 0.9.8_7. A chart with no padding of its own — in a sidenote, a panel row cell or a panel body — can lose up to about 24px of its outermost axis and slice labels: the chart clips its drawing at the element’s edge. Give such a chart a little padding until then.

<div id="chart" class="panel panel--bordered text-content-caption"></div>

new RareCharts.Line('#chart', { title: 'Weekly active users' }).setData(data);

The panel's layout has zero specificity, so a layout utility on the same element (.grid) and the chart's own layout win whatever order the stylesheets load in. Its padding does not: like every component's, it wins over a spacing utility on the same element — use .panel--flush, or wrap the content, for other padding.

Renamed in v0.7.2

Before v0.7.2 the bordered panel and the panel row were misfiled under the card as .card-dashboard-bordered and .card-row-bordered / .card-row-bordered-item. Those names were removed with no alias: .card-dashboard-bordered is now .panel .panel--bordered (both classes: the padding is the panel's, the frame the modifier's), and the row is .panel__row / .panel__row-item. The migration table has the details.