Section

The band every block stands in: a stretch of the page holding its content to a readable width under an optional eyebrow, title, tagline and description.

Eyebrow

Title Tagline

Description

Content goes here.
import { Section } from "@produkto/ui/Section";

const Example = () => (
  <Section
    description="Description"
    eyebrow="Eyebrow"
    tagline="Tagline"
    title="Title"
  >
    <div className="flex h-40 items-center justify-center rounded-2xl border border-border description-sm">
      Content goes here.
    </div>
  </Section>
);

export default Example;

Usage

import { Section } from "@produkto/ui/Section";
<Section eyebrow="Eyebrow" title="Title" description="Description">
  <p>Content goes here.</p>
</Section>

Examples

Align

align sets the heading and its buttons at the start, the default, centred over the content, or at the end.

Eyebrow

Start

Description

Eyebrow

Center

Description

Eyebrow

End

Description

import { Section, type SectionAlign } from "@produkto/ui/Section";

const aligns: { align: SectionAlign; label: string }[] = [
  { align: "start", label: "Start" },
  { align: "center", label: "Center" },
  { align: "end", label: "End" },
];

const Example = () => (
  <>
    {aligns.map((item) => (
      <Section
        actions={[{ label: "Button", link: "#" }]}
        align={item.align}
        description="Description"
        eyebrow="Eyebrow"
        key={item.align}
        title={item.label}
      />
    ))}
  </>
);

export default Example;

Header layout

headerLayout="split" sets the eyebrow and title in one half and the description with the buttons in the other; stacked, the default, sets them one under the other.

Eyebrow

Title

Description

import { Section } from "@produkto/ui/Section";

const Example = () => (
  <Section
    actions={[{ label: "Button", link: "#" }]}
    description="Description"
    eyebrow="Eyebrow"
    headerLayout="split"
    title="Title"
  />
);

export default Example;

Width

width holds the content to a measure: narrow for reading, base, the default, or wide, which grows past base on screens wider than this page.

Narrow
Base
Wide
import { Section, type SectionWidth } from "@produkto/ui/Section";

const widths: { width: SectionWidth; label: string }[] = [
  { width: "narrow", label: "Narrow" },
  { width: "base", label: "Base" },
  { width: "wide", label: "Wide" },
];

const Example = () => (
  <>
    {widths.map((item) => (
      <Section key={item.width} width={item.width}>
        <div className="flex h-20 items-center justify-center rounded-2xl border border-border description-sm">
          {item.label}
        </div>
      </Section>
    ))}
  </>
);

export default Example;

Muted

muted lays the band on the muted ground to set it apart from the bands beside it, where by default it is on the page's background.

Eyebrow

Background

Description

Eyebrow

Muted

Description

import { Section } from "@produkto/ui/Section";

const Example = () => (
  <>
    <Section description="Description" eyebrow="Eyebrow" title="Background" />
    <Section description="Description" eyebrow="Eyebrow" muted title="Muted" />
  </>
);

export default Example;

Ruled

ruled draws guide lines down the content's edges and a rule across the top, which ruled bands in a row share, here under a band as it is by default.

Eyebrow

Title

Description

Eyebrow

Title

Description

Eyebrow

Title

Description

import { Section } from "@produkto/ui/Section";

const Example = () => (
  <>
    <Section description="Description" eyebrow="Eyebrow" title="Title" />
    <Section description="Description" eyebrow="Eyebrow" ruled title="Title" />
    <Section description="Description" eyebrow="Eyebrow" ruled title="Title" />
  </>
);

export default Example;

Theme

theme sets the band in the light or the dark theme whatever the page is in; by default it follows the page, here above a light band and a dark one.

Eyebrow

Title

Description

Eyebrow

Title

Description

Eyebrow

Title

Description

import { Section } from "@produkto/ui/Section";

const Example = () => (
  <>
    <Section description="Description" eyebrow="Eyebrow" title="Title" />
    <Section
      description="Description"
      eyebrow="Eyebrow"
      theme="light"
      title="Title"
    />
    <Section
      description="Description"
      eyebrow="Eyebrow"
      theme="dark"
      title="Title"
    />
  </>
);

export default Example;

Actions

actions sets buttons under the heading, the first solid and the others outline unless an action names its own appearance; by default there are none.

Eyebrow

Title

Description

import { Section } from "@produkto/ui/Section";

const Example = () => (
  <Section
    actions={[
      { label: "Button", link: "#" },
      { label: "Button", link: "#" },
    ]}
    description="Description"
    eyebrow="Eyebrow"
    title="Title"
  />
);

export default Example;

API Reference

Section

SectionProps · components/Section/Section.types.ts
PropTypeDefault
eyebrowstring-
titleReactNode-
taglineReactNode-
descriptionReactNode-
alignSectionAlign"start" | "center" | "end""start"
headerLayoutSectionHeaderLayout"stacked" | "split""stacked"
widthSectionWidth"narrow" | "base" | "wide""base"
mutedbooleanfalse
ruledbooleanfalse
themeThemeMode"light" | "dark"-
actions(BlockAction | BlockMenuAction)[]-

SectionHeader

SectionHeaderProps · also takes the props of <header>
PropTypeDefault
eyebrowstring-
titleReactNode-
taglineReactNode-
descriptionReactNode-
alignSectionAlign"start" | "center" | "end""start"
layoutSectionHeaderLayout"stacked" | "split""stacked"
actions(BlockAction | BlockMenuAction)[]-

BlockActions

BlockActionsProps
PropTypeDefault
actions(BlockAction | BlockMenuAction)[]-
alignSectionAlign"start" | "center" | "end""start"
sizeBlockActionsSize"sm" | "base" | "lg""lg"
classNamestring-

BlockAvatar

BlockAvatarProps
PropTypeDefault
namerequiredstring-
srcstring-
sizeBlockAvatarSize"sm" | "base" | "lg" | "xl""base"
classNamestring-

BlockAction

used by actions
PropTypeDefault
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent"-
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
iconReactNode-
iconOnlyboolean-
borderRadiusBlockActionBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
labelrequiredstring-
linkrequiredstring-

BlockMenuAction

used by actions
PropTypeDefault
labelrequiredstring-
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent"-
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
iconReactNode-
iconOnlyboolean-
borderRadiusBlockActionBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
itemsrequiredBlockMenuItem[]-

BlockMenuItem

used by its parts
PropTypeDefault
labelrequiredstring-
iconReactNode-
linkstring-
onSelect() => void-

It also takes the props of <section>.