Section
Layout primitives shared by every block: Section, Container and SectionHeader.
Changelog
Shipped this week.
Every block uses the same header, container and vertical rhythm, so sections always line up.
Installation#
pnpm dlx shadcn@latest add https://ui.balick.me/r/section.jsonOr, with the namespace configured: @balick/section
Usage#
import { Section, SectionHeader } from "@/components/ui/section"
export function Faq() {
return (
<Section>
<SectionHeader
eyebrow="FAQ"
title="Questions, answered."
description="Everything you need to know before getting started."
/>
<div className="mt-16">{/* Your content */}</div>
</Section>
)
}Props#
<Section />
| Prop | Type | Default | Description |
|---|---|---|---|
spacingVertical padding. Use "none" when the block manages its own. | "none" | "compact" | "default" | "default" | Vertical padding. Use "none" when the block manages its own. |
widthMaximum width of the content: 3xl, 6xl or 7xl. | "narrow" | "default" | "wide" | "default" | Maximum width of the content: 3xl, 6xl or 7xl. |
containerClassNameClasses applied to the inner container. | string | — | Classes applied to the inner container. |
<Container />
| Prop | Type | Default | Description |
|---|---|---|---|
widthMaximum width of the content: 3xl, 6xl or 7xl. | "narrow" | "default" | "wide" | "default" | Maximum width of the content: 3xl, 6xl or 7xl. |
<SectionHeader />
| Prop | Type | Default | Description |
|---|---|---|---|
titleHeading of the section. Required. | ReactNode | — | Heading of the section. Required. |
eyebrowShort label above the title, set in monospace capitals. | ReactNode | — | Short label above the title, set in monospace capitals. |
descriptionSupporting text under the title. | ReactNode | — | Supporting text under the title. |
alignAlignment of the header. | "center" | "left" | "center" | Alignment of the header. |
asHeading level of the title. | "h1" | "h2" | "h3" | "h2" | Heading level of the title. |
childrenActions shown under the description, such as a toggle or buttons. | ReactNode | — | Actions shown under the description, such as a toggle or buttons. |