Skip to main content
xriptxr

Section

Info:Layout
58

A page band or a framed stage: the full-width strips and demo grounds a page is built from.

band region stage page section container

Live demo

live · @xtyle/astro

Section

tone="plain" · bordered

A plain band with hairline rules

tone="quiet" · bordered

41Components
179Tokens
3Bindings

tone="accent" · bordered

An accent call-to-action band

padding="sm"

padding="md"

padding="lg"

Every tone

Beyond plain and quiet, a band tints with any tone in the roster — a soft awareness strip, a status band, whatever the page calls for.

Accents

tone="accent"

tone="accent-2"

tone="accent-3"

tone="accent-4"

tone="neutral"

Statuses

tone="success"

tone="warn"

tone="danger"

Named hues

tone="red"

tone="orange"

tone="yellow"

tone="green"

tone="blue"

tone="purple"

tone="brown"

tone="pink"

tone="cyan"

tone="gray"

tone="white"

tone="black"

Section is the structural strip between the page primitives and the page itself: a padded surface band you lay content across, or a framed stage for showing something off. As a band it carries a tone (transparent (plain), a neutral raise (quiet), or a tint from the full tone roster: any semantic role, accent variant, or named hue) and optional bordered hairlines top and bottom, with a padding rhythm that eases off on narrow screens.

As a stage (variant="stage") it becomes an elevated, accent-tinted frame with an optional corner label: the demo ground this very site sits its live examples in. It owns surface and spacing only; arrange what goes inside with Stack, Cluster, or Grid.

When to use

How this component composes with the rest of the set.

Stack page bands down a route (a plain hero, a quiet stats band, an accent call-to-action) for rhythm without bespoke section CSS.
Use variant="stage" to frame a live demo or a hero preview, and pass label for a provenance tag.
Section owns surface and padding only; compose the contents with Stack, Cluster, or Grid.

Props

6 props, straight from the manifest.

PropTypeDefaultBindingsDescription
as SectionTag
section div header footer
section
html svelte astro
The element to render. A landmark band is usually section; a stage is often a div.
variant SectionVariant
band stage
band
html svelte astro
A full-width surface band, or a framed, elevated stage.
tone SectionTone
plain quiet accent neutral danger success warn info accent-2 accent-3 accent-4 red orange yellow green blue purple brown pink cyan gray white black
plain
html svelte astro
The band surface: transparent (plain), a neutral raise (quiet), or a tint from the full tone roster, any semantic role, accent variant, or named hue (accent, success, pink, …). Ignored by the stage.
bordered boolean false
html svelte astro
Adds hairline rules along the top and bottom of a band, in the tone's edge color.
padding SectionPadding
none sm md lg
lg
html svelte astro
Vertical rhythm of the band, eased off under 40rem. (lg is the base; the stage sets its own.)
label string
html svelte astro
A corner tag for a stage (e.g. a live · @xtyle/astro provenance line).

Appearance

Variants

band

.xtyle-section

A full-width surface strip, toned and optionally ruled; the default variant.

stage

.xtyle-section--stage

A framed, elevated, accent-tinted demo ground with an optional corner label.

Sizes

sm

.xtyle-section--sm

Tighter band padding.

md

.xtyle-section--md

Medium band padding.

lg

default
.xtyle-section

Generous band padding (default).

Anatomy

The named parts that make up the component. A ::part() handle is reachable from your own stylesheet; the class beside it is the component's internal selector, which a shadow boundary keeps to itself.

section

Success:::part(section) .xtyle-section

The band or stage root carrying the variant, tone, border, and padding classes.

--space-8 --space-6 --space-5 --space-4 --bg-1 --accent-bg --border-thin --line --accent

stage

internal .xtyle-section--stage

The framed-demo treatment: an accent-tinted, elevated, rounded ground.

--accent-bg --bg-2 --border-thin --accent --radius-lg --elevation-3 --ring-bg --space-6

label

Success:::part(label) .xtyle-section__label

The optional monospace corner tag on a stage, pinned top-right.

--space-2 --space-3 --font-mono --text-xs --accent-text

Tokens & coverage

What the component consumes, checked live against what the algorithm produces.

Success:fully covered 58/58 consumed tokens produced default register: 310 tokens

Live coverage check against the xtyle-default register (derive(xtyleDefault, { anchors })coverComponent(manifest, register)). Every token this component consumes must be a key the algorithm produces.

--accent --accent-2 --accent-2-bg --accent-3 --accent-3-bg --accent-4 --accent-4-bg --accent-bg --accent-text --bg-1 --bg-2 --black --black-bg --blue --blue-bg --border-thin --brown --brown-bg --cyan --cyan-bg --danger --danger-bg --elevation-3 --font-mono --gray --gray-bg --green --green-bg --info --info-bg --line --neutral --neutral-bg --orange --orange-bg --pink --pink-bg --purple --purple-bg --radius-lg --red --red-bg --ring-bg --space-2 --space-3 --space-4 --space-5 --space-6 --space-8 --success --success-bg --text-xs --warn --warn-bg --white --white-bg --yellow --yellow-bg

Slots

default
html svelte astro

The band or stage contents.

Accessibility

Choose as for the landmark you mean: section (optionally with an aria-label), header, or footer. A plain div stage carries no landmark role, which is usually right for a demo frame.
Surface tones are decorative; the band's meaning comes from its content and heading, never the background color.
The stage corner label is plain text in the flow; keep it short, since it reads before the framed content.

Code

Bands and stages

The three band tones with and without rules, the padding rhythm, and the framed stage with a corner label.

<xtyle-section tone="accent" bordered>
	<h2>A page band</h2>
	<p>A full-width strip with its own surface and hairline rules.</p>
</xtyle-section>

<xtyle-section variant="stage" label="live · @xtyle/astro">
	<xtyle-button>A framed demo ground</xtyle-button>
</xtyle-section>