Layout
Panel
The raised surface every larger component is built on, and the canonical panel weight: a 4px ink outline and a hard 6px block.
This is the component that defines rule 3's heavier step, and the one
to reach for when a consumer needs to raise an arbitrary block of content
into the language without waiting for us to ship a component for it. It owns
its padding so no consumer has to invent one; --axi-panel-pad tightens or
loosens a single instance without a modifier class.
A panel is the raised thing, which means what goes inside it usually is not: a table, a meter and a plot all sit flat in a panel and carry no block of their own.
--float is for a panel over moving content rather than one in the page - a
readout pinned to a chart, a popover over a scrolling table. Under a theme
like glass --axi-surface is a translucent tint, which reads as a pane only
while what is behind it holds still; the moment the content scrolls it shows
through. --axi-surface-float is the surface for that case, and
.axi-rail--float says the same thing about the other surface that needs
it.
--tile is for a panel standing in a grid of its own kind rather than alone
in the page. It drops the border, the block and the corner one step, to the
control weight, so a row of six does not read as six page regions arguing with the
page that holds them - and because the ramp has two steps, a plain
.axi-panel among tiles outranks them. That is how a grid of readings says
"this one is first" without a hue: the accent is not available for it anyway,
since gold means the thing you picked and nobody picks a winner. A tile that
is also a button or a link lifts under the press with no extra class, keyed
off the element.
A panel in a set where one is chosen says so by its own state, not by a
modifier: [aria-current], [aria-pressed="true"], [aria-selected="true"],
or a checked radio it directly contains. The surface rises to
--axi-surface-raised and the accent moves to the edge - not an accent fill,
which is right for a rail item (a word can be printed on the accent) and wrong
for a panel (content cannot). .axi-card takes the same state from the same
rule, so it does not matter which of the two you are marking.
Which attribute is not a style choice - each is already correct for one semantics, and the state you set is the one a screen reader reads. The failure this replaces is a consumer that appended an accent-border utility at ten sites: it looked picked and announced nothing.
Two panels, one tightened
Per-instance padding, no modifier classPanel — default padding
A panel owns its padding so no consumer has to invent one.
Panel — tighter
Set --axi-panel-pad: 13px on the instance.
<div class="axi-row" style="--axi-row-gap: 12px; align-items: stretch">
<div class="axi-panel" style="flex: 1 1 240px">
<p class="axi-eyebrow">Panel — default padding</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">A panel owns its padding so no consumer has to invent one.</p>
</div>
<div class="axi-panel" style="flex: 1 1 240px; --axi-panel-pad: 13px">
<p class="axi-eyebrow">Panel — tighter</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">Set --axi-panel-pad: 13px on the instance.</p>
</div>
</div>
Floating
Switch to the glass theme to see the difference: the default panel goes translucent, the floating one stays a surfacePanel — in the page
Content behind it holds still, so a tint is fine.
Panel — floating
Content scrolls behind it, so the surface has to be opaque.
<div class="axi-row" style="--axi-row-gap: 12px; align-items: stretch">
<div class="axi-panel" style="flex: 1 1 240px; --axi-panel-pad: 13px">
<p class="axi-eyebrow">Panel — in the page</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">Content behind it holds still, so a tint is fine.</p>
</div>
<div class="axi-panel axi-panel--float" style="flex: 1 1 240px; --axi-panel-pad: 13px">
<p class="axi-eyebrow">Panel — floating</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">Content scrolls behind it, so the surface has to be opaque.</p>
</div>
</div>
A picker of panels, one of them chosen
The state is on the markup, not in a class: a label wrapping its own radio. Tab into it and use the arrow keys — the mark follows the radio, because the radio is what holds it<div class="axi-row" style="--axi-row-gap: 12px; align-items: stretch" role="radiogroup" aria-label="Surface treatment">
<label class="axi-panel axi-panel--tile" style="flex: 1 1 200px; cursor: pointer">
<input type="radio" name="axi-demo-surface" class="axi-sr-only" checked>
<p class="axi-eyebrow">The language</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">Opaque surfaces, square corners.</p>
</label>
<label class="axi-panel axi-panel--tile" style="flex: 1 1 200px; cursor: pointer">
<input type="radio" name="axi-demo-surface" class="axi-sr-only">
<p class="axi-eyebrow">Flat</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">No blocks, hairline rules.</p>
</label>
<label class="axi-panel axi-panel--tile" style="flex: 1 1 200px; cursor: pointer">
<input type="radio" name="axi-demo-surface" class="axi-sr-only">
<p class="axi-eyebrow">Glass</p>
<p style="margin: 0; font: var(--axi-t-small); color: var(--axi-text-dim)">Translucent, blurred, rounded.</p>
</label>
</div>
A grid of tiles, one of them first
Rank said with the form ramp: the winner is a plain panel among tiles, no colour spentFirst
1,284
Second
1,102
Third
998
<div class="axi-row" style="--axi-row-gap: 12px; align-items: stretch">
<div class="axi-panel" style="flex: 1 1 150px; --axi-panel-pad: 12px">
<p class="axi-eyebrow">First</p>
<p class="axi-ink-plain" style="margin: 0; font: var(--axi-t-h3)">1,284</p>
</div>
<div class="axi-panel axi-panel--tile" style="flex: 1 1 150px">
<p class="axi-eyebrow">Second</p>
<p class="axi-ink-dim" style="margin: 0; font: var(--axi-t-h3)">1,102</p>
</div>
<div class="axi-panel axi-panel--tile" style="flex: 1 1 150px">
<p class="axi-eyebrow">Third</p>
<p class="axi-ink-dim" style="margin: 0; font: var(--axi-t-h3)">998</p>
</div>
</div>
Knobs
| Property | Sets | Fallback |
|---|---|---|
--axi-panel-pad | .axi-panel's own padding | 26px |