Layout

Section

Standard section block, heading, description, and content area.

Preview
01 Installation

Install

Pull Section from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { Section } from "@brika/clay";
tsxGranular1 line
import { Section } from "@brika/clay/components/section";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxSection.tsx32 lines
import {
  Section,
  SectionContent,
  SectionDescription,
  SectionHeader,
  SectionIcon,
  SectionInfo,
  SectionTitle,
} from '@brika/clay/components/section';
import { Server } from 'lucide-react';

/** Section card with a header and body content. */
export default function SectionDefaultDemo() {
  return (
    <Section className="w-full max-w-md">
      <SectionHeader>
        <SectionInfo>
          <SectionIcon>
            <Server className="size-4" />
          </SectionIcon>
          <div>
            <SectionTitle>Database</SectionTitle>
            <SectionDescription>PostgreSQL 16, primary cluster</SectionDescription>
          </div>
        </SectionInfo>
      </SectionHeader>
      <SectionContent>
        <p className="text-muted-foreground text-sm">Connection pool: 18 / 100 active.</p>
      </SectionContent>
    </Section>
  );
}
03 Examples

Section, every way

With Action

Action button and a badge in the header's right slot, for settings panels with inline controls.

04 Accessibility

Accessibility

  • SectionTitle renders as <h2> by default, adjust via the as prop to maintain heading hierarchy.
  • Actions in the header slot should have descriptive labels matching the operation.
05 Tokens 1 theme-overridable

Theme tokens

Every CSS variable Section reads, with its default and the dotted path you'd write in a ThemeConfig JSON to override it. Set any of these in your theme to retune Section without touching component code.

Section tokens

1 token
ColorFill, border, and text colors.1
  • --section-description-colorcolorvar(--muted-foreground)
    components.section.descriptionColor

    Foreground color of `<SectionDescription>`, the muted line under the section title.

Override in a theme

Authoring a theme is plain JSON. Drop overrides under components.section, the names are camelCase versions of the variable suffix.

jsonmy-theme.json12 lines
{
  "id": "my-theme",
  "name": "My Theme",
  "description": "...",
  "accentSwatches": ["#000"],

  "components": {
    "section": {
      "descriptionColor": "var(--muted-foreground)"
    }
  }
}

Then apply with applyTheme(myTheme) (see the theming guide), scope it to a subtree with themeToCssVars(myTheme, mode), or consume any token directly in your own JSX with the matching Tailwind utility (e.g. bg-section-…) — see the chips on each token row.

06 API reference

API reference

Props specific to Section. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

<Section />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SectionContent />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SectionDescription />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SectionHeader />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SectionIcon />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SectionInfo />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<SectionTitle />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.