Skip to content

Section Header

Uppercase heading element for labeling content sections, with configurable heading level and variant.

Preview

Installation

$pnpm exec dgadd add ui/section-header
[Installs to]src/components/ui/section-header[Item]ui/section-header

dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.

UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.

Usage

tsx
import { SectionHeader } from "@/components/ui/section-header";export default function SectionHeaderDefault() {  return (    <div className="max-w-md">      <SectionHeader as="h2" bordered className="mb-3">        Review Findings      </SectionHeader>      <p className="mb-6 text-sm leading-relaxed text-muted-foreground">        Three findings across two files. Severity comes from the analyzer, not from the diff size.      </p>      <SectionHeader className="mb-2">Blocking</SectionHeader>      <p className="text-sm leading-relaxed text-muted-foreground">        The retry loop swallows the original rejection, so the failing request is never reported.      </p>    </div>  );}

Examples

Variants

Preview

API Reference

SectionHeader

NameTypeDefaultDescription
as"h2" | "h3" | "h4""h3"Heading level. Choose the level that matches your document outline.
variant"default" | "muted" | "accent""default"Color intensity. Default uses foreground, muted uses muted-foreground, accent uses the theme accent.
borderedbooleanfalseAdds a bottom border under the heading.
childrenReactNodeHeading text.

Accessibility

Notes

Variant

The variant prop controls visual intensity. Default uses foreground color, muted uses muted-foreground, and accent uses the theme accent for a highlighted section label.

Heading Level

The as prop renders as h2, h3, or h4 (defaults to h3). Each level carries its own size, weight, and letter-spacing so the three read as a scale: h2 is the largest and tightest, h4 the smallest and widest-tracked.

Spacing

SectionHeader owns no outside margin. The layout that places the header decides the gap below it (for example mb-2 next to body copy, or a flex gap in a stacked panel).

Source

Install via CLI: pnpm exec dgadd add ui/section-header.

Highlighted source loads after this disclosure opens. Browse the source repository.