Skip to Content
BBRICKSv0.7.4
KitPatterns

SectionHeading

A heading over a group of cards, outside any card (the PR mock's h2 "Change the commission": the display face, 17px, 700, no margin): the same look as a card's title. Space it from what follows with the layout around it (a PageGrid's gap).

import { SectionHeading } from '@ergasti/bricks';

Examples

Card with a header

Card.Header takes a title, a sub line and actions; Card.Body pads the content.

Code
import { Button, Card } from '@ergasti/bricks';

function Basic() {
  return (
    <div style={{ maxWidth: 460 }}>
      <Card>
        <Card.Header title="Seat usage" sub="How many creators your plan lets you have" actions={<Button size="sm">Raise limit?</Button>} />
        <Card.Body>321 of 400 seats are used.</Card.Body>
      </Card>
    </div>
  );
}

Tones

tone="lime" marks a positive or new card; tone="lilac" is the PR portal's soft card (a brand request, a message). Leave tone out for the plain white card, which most cards are. Card.Header's level sets its heading level (default 2), here 3 for cards under a section heading.

Code
import { Card } from '@ergasti/bricks';

function Lime() {
  return (
    <div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))' }}>
      <Card>
        <Card.Header level={3} title="Back to campus" sub="Ended · 30 Nov" />
        <Card.Body>80 of 80 gifts were taken.</Card.Body>
      </Card>
      <Card tone="lime">
        <Card.Header level={3} title="Winter glow launch" sub="Live · day 13 of 30" />
        <Card.Body>68 of 100 gifts have been taken.</Card.Body>
      </Card>
      <Card tone="lilac">
        <Card.Header level={3} title="Brand request" sub="Glow Lab · sent 12 Nov" />
        <Card.Body>A December challenge for the new serum, top 10 by sales.</Card.Body>
      </Card>
    </div>
  );
}

Header from props

title, sub (as on <Card.Header>), badge and actions draw the card's header for you: a 17px title, the 13px grey line 2px under it, then the status pill and the actions at the end, with the content 16px below. headingLevel (default 2) sets the title's heading level.

Code
import { Button, Card, Pill } from '@ergasti/bricks';

function HeaderProps() {
  return (
    <div style={{ display: 'grid', gap: 16, maxWidth: 560 }}>
      <Card title="Warehouse details" sub="Every brand sees these on its Gifts page" actions={<Button size="sm" variant="ink">Save</Button>}>
        <div>Warehouse 4, Industrial Zone 3, 6th of October City, Giza</div>
      </Card>
      <Card title="Affiliate program" sub="Since March 2026" badge={<Pill tone="ok">Active</Pill>} headingLevel={3}>
        <div>15% of sale on every order with a creator code.</div>
      </Card>
    </div>
  );
}

Named regions

A card with a title (or a <Card.Header>) is a region named by its heading, so screen readers can list and jump to it. labelledBy names it by another element's id instead: here the visible heading sits outside the card's own header.

Code
import { Card } from '@ergasti/bricks';

function LabelledBy() {
  return (
    <div style={{ display: 'grid', gap: 8, maxWidth: 460 }}>
      <h3 id="card-ex-stock" style={{ margin: 0 }}>Stock room</h3>
      <Card labelledBy="card-ex-stock">
        <Card.Body>120 serum sets ready to ship.</Card.Body>
      </Card>
    </div>
  );
}

Inset card

variant="inset" is a card inside a drawer section (the PR Portal's creator score card): 16px padding, a line border, no gap between its parts and a 15px title; a paragraph straight inside sits 10px under what is above it.

Code (not run)
import { Card, DetailsBars } from '@ergasti/bricks';

function Inset() {
  return (
    <div style={{ maxWidth: 372 }}>
      <Card variant="inset" title="TRNDR score" headingLevel={3} badge={<b style={{ fontSize: 24 }}>62 <span className="kit-muted" style={{ fontSize: 13 }}>/ 100</span></b>}>
        <DetailsBars variant="stacked" label="TRNDR score" bars={[{ label: 'Sales', note: 'EGP 18.2K', value: '30 / 35', percent: 86 }, { label: 'Engagement', note: '3.1%', value: '14 / 20', percent: 70 }]} />
        <p className="kit-muted" style={{ fontSize: 12.5 }}>Score = points earned ÷ points we can measure × 100.</p>
      </Card>
    </div>
  );
}

footer is the card's last row over a rule (14px above and under the line); footerAlign="between" puts Back at the start and Continue at the end. SectionHeading is the same 17px heading over a group of cards, outside any card.

Code
import { Button, Card, SectionHeading } from '@ergasti/bricks';

function FooterAndSection() {
  return (
    <section aria-labelledby="ex-steps" style={{ display: 'grid', gap: 12, maxWidth: 460 }}>
      <SectionHeading id="ex-steps">New challenge</SectionHeading>
      <Card title="Basics" footerAlign="between" footer={<><Button variant="ghost" disabled>Back</Button><Button variant="ink">Continue</Button></>}>
        <p style={{ margin: 0 }}>Who it&apos;s for, the name and the dates.</p>
      </Card>
    </section>
  );
}

Props

Prop

Type

Design guidance

How the BRICKS design system uses SectionHeading. Written in docs/content/components/SectionHeading.md; the props above are read from the code, which wins where the two disagree.

A heading over a group of cards, outside any card, in the card-title look (display face, 17px, 700, no margin); use it when a page has a titled section made of several cards ("Change the commission").

It is the PR v3 mock's bare <h2 style="font-size:17px;margin:0 0 12px"> between two grids on a brand's campaign page. Before 0.7 screens wrote that heading with inline styles; use SectionHeading instead so it matches a Card title exactly and resets the letter-spacing for Arabic. It has no margin: space it with the layout around it (a PageGrid stack's 16px gap, or a 12px grid as in the story). It is exported from the same file as Card.

Anatomy

  1. Heading: <h2 class="kit-sec-h"> (or h3–h6 with level): --font-family-display, 17px, 700, --tracking-display letter-spacing, margin: 0.

Variants

Prop valueLookWhen to use
level={2} (default)<h2>A section directly under the page's h1 (the header title).
level={3}–6Same look, lower levelA section nested inside another headed section (story Level3: "Gift rules").
id—Name the section it heads: <section aria-labelledby={id}>.

States

Static text: no interactive states. Long titles wrap.

Usage

// PR Portal › Affiliate programs › a brand's campaign: "Change the commission" over the form and its preview
import { Card, PageGrid, SectionHeading } from '@ergasti/bricks';

export function ChangeCommissionSection() {
  return (
    <section aria-labelledby="change-commission" style={{ display: 'grid', gap: 12 }}>
      <SectionHeading id="change-commission">Change the commission</SectionHeading>
      <PageGrid split="7-5">
        <Card title="How creators earn" headingLevel={3}><p style={{ margin: 0 }}>10% of sale</p></Card>
        <Card title="What changes" headingLevel={3}><p style={{ margin: 0 }}>New orders only</p></Card>
      </PageGrid>
    </section>
  );
}
// A nested section
import { SectionHeading } from '@ergasti/bricks';

export function GiftRulesHeading() {
  return <SectionHeading level={3}>Gift rules</SectionHeading>;
}

Where it appears

Guidelines

Do

  • Use it only for a heading that sits outside cards and covers more than one card.
  • Give it an id and wrap the group in <section aria-labelledby> when the group is a real section.
  • Lower the cards' own headingLevel under it when they are its sub-parts.

Don't

  • Don't use it inside a card; that is the card's title (Card / Card.Header).
  • Don't use it for the page title; that is AppHeader / PrPortalFrame title (the h1).
  • Don't add margins to it; space it with the surrounding grid.

RTL and Arabic

  • Letter-spacing resets to 0 in RTL (Arabic is never tracked). Text aligns to the inline start.
  • Arabic from the story: "غيّر العمولة".

Tokens

--font-family-display, --tracking-display.

Accessibility

  • A real heading element at the level you give (default h2), so it appears in the headings list.
  • With id, it can name a <section> landmark-like region through aria-labelledby.
  • It does not change the levels of the cards under it; set them yourself.

Found in the source

  • ARIA attributes set: aria-labelledby.
  • Its tests cover: “a 0 sub is shown; labelledBy still names the region”; “a titled card is a region named by its title; labelledBy still wins”.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Button · Pill · DetailsBars · Accordion · HeroCard · KeyValue

Source

src/kit/patterns/Card.tsx (line 131) on GitHub.

On this page