Section

A full-bleed page band with generous vertical padding. Alternate default and tray sections to separate regions of a page by surface instead of borders.

StableSource

Pricing

One plan, billed monthly.

Import

tsx
import { Section } from "@merid/react";

Examples

Tones

default uses the page background; tray uses --mrd-tray for a recessed alternate band. Alternating the two is how a long page gets structure without dividers.

Default tone: the page background.

Tray tone: the recessed alternate band.

Spacing

default padding is --mrd-section (112px, stepping down to 80px and 64px on smaller screens). compact halves it; none removes it when you need the band only for its background.

compact: half of --mrd-section

none: no vertical padding

Cards on a tray section

A tray card would disappear on a tray section, so inside Section tone="tray" Merid flips tray cards to the surface colour. Use variant="elevated" for cards that should read as lifted.

An elevated card reads as a lifted surface on a tray section.

API reference

Section renders a <section> by default, forwards its ref and passes other HTML attributes through.

PropTypeDefaultDescription
tone"default" | "tray""default"Background: page bg or the recessed tray.
spacing"default" | "compact" | "none""default"Vertical padding: --mrd-section, half of it, or none.
asElementType"section"Element or component to render instead.

Styling

HookValues
.mrd-sectionRoot element
data-tonedefault · tray
data-spacingdefault · compact · none

Padding comes from the global --mrd-section token; override it on the element to change the rhythm of one band.

css
.hero.mrd-section {
  --mrd-section: 160px;
}

Accessibility

  • A <section> is only exposed as a landmark when it has an accessible name. Give important bands an aria-labelledby pointing at their heading.
  • Use as="div" for purely visual bands that do not start a new topic.

Guidelines

Do

Alternate default and tray sections to separate page regions.

Avoid

Stack two tray sections back to back, or add borders between sections.

  • Container — caps the width of content inside a section.
  • Card — surfaces that adapt to a tray section.
  • Stack — spacing between blocks within a section.