Section
A semantic <section> with a space preset for vertical padding. Pairs naturally with Container to compose evenly-spaced page sections without bespoke padding math.
Renders the native <section> element so each section is a landmark for AT. Always provide a label — aria-labelledby pointing at the section's heading is the most accessible option, or aria-label when there is no heading.
Preview
tsx
import { Container, Section, Text } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<Section paddingY="8" background="bg.subtle">
<Container size="md">
<Text>Section content</Text>
</Container>
</Section>
);
}
Space presets
Section titled “Space presets”space controls the section’s vertical padding: sm, md (default), lg, xl. Use lg or xl for marketing pages; sm for compact tools.
Preview
tsx
import { Section, Stack, Text } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<Stack gap="2">
{(['sm', 'md', 'lg', 'xl'] as const).map((space) => (
<Section key={space} space={space} background="bg.subtle" borderRadius="md">
<Text>
<code>space="{space}"</code>
</Text>
</Section>
))}
</Stack>
);
}
Nesting with Container
Section titled “Nesting with Container”The canonical composition is <Section><Container>...</Container></Section>: Section owns vertical rhythm, Container owns horizontal measure. Together they produce the standard “padded, centered” page section.
Preview
tsx
import { Container, Heading, Section, Stack, Text } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<Section space="lg" background="bg.subtle" borderRadius="md">
<Container size="md">
<Stack gap="3">
<Heading level={2} size="lg" id="features">
Features
</Heading>
<Text color="fg.muted">
Section owns the vertical rhythm; Container caps the horizontal measure. Together they
produce a padded, centred slab of content with no bespoke CSS.
</Text>
</Stack>
</Container>
</Section>
);
}
PropTypeDefaultDescription
className
string
—
Additional class names appended after Cynosure's base classes.
style
CSSProperties
—
Inline style overrides merged last.
children
ReactNode
—
Section content.
space
"sm"|"md"|"lg"|"xl"
"md"
Vertical padding preset — `sm`, `md`, `lg`, or `xl` — driving the band's
top/bottom rhythm.
paddingX
—
Horizontal padding (left + right). Overrides `padding` on the X axis.
paddingY
—
Vertical padding (top + bottom). Overrides `padding` on the Y axis.
height
—
Element height. Accepts a `SpaceToken`, `LengthValue`, or named alias.
minWidth
—
Minimum width — useful for preventing flex children from collapsing.
background
—
Background colour. Use a `ColorToken` like `"bg.surface"` for theme awareness.
borderColor
—
Border colour. Pair with `borderWidth` to make the border visible.
opacity
Responsive<number | `${number}`>
—
Opacity 0–1. Use sparingly — prefer surface tokens over translucency.
overflowX
—
Horizontal-axis overflow control. Overrides `overflow` for the X axis.
display
—
CSS `display` value. `"contents"` removes the element's box from layout.
position
—
CSS `position`. Pair with `top`/`right`/`bottom`/`left` for placement.
top
—
Top inset (when positioned). Accepts a `SpaceToken`, `"auto"`, `"0"`, or `LengthValue`.
flex
Responsive<"1" | "none" | "auto" | "initial" | (string & {})>
—
Shorthand: `1 | auto | none | initial | <css>`. Resolves to `flex` on the child.
asChild
boolean
—
When `true`, renders the primitive's single React child via `Slot`,
forwarding className/style/ref/event handlers onto it.
as
ElementType
"section"
Rendered intrinsic element — restrict to landmark tags for accessibility.
ref
ForwardedRef<Element>
—
Recipes
Section titled “Recipes”- Landing-page sections:
<Section space="xl" aria-labelledby="cta-heading"><Container size="lg">...</Container></Section>. - Dashboard panels:
<Section space="sm">keeps panels visually distinct without inflating the page. - Alternate background colours per section via
background="bg.subtle"to delineate without dividers.