import { Heading, Text } from "@senvenli/react/display";
import { Box, Container, Grid, Section, Stack } from "@senvenli/react/layout";
const STEPS = [
{ title: "Create a project", detail: "Name it and pick a template." },
{ title: "Invite your team", detail: "Everyone works from the same plan." },
{ title: "Send the invoice", detail: "Bill the work as soon as it is done." },
];
export default function Example() {
return (
// The heading names the band: a landmark with a name is listed by screen readers.
<Section density="compact" aria-labelledby="how-it-works">
<Container>
<Stack space="space-150">
<Text size="body-small" weight="medium" tone="brand">How it works</Text>
<Heading id="how-it-works" level={2} size="heading-xxlarge">From first task to paid invoice</Heading>
<Text size="body-large" tone="subtle">Plan the work, track it with your team and bill it from one place.</Text>
</Stack>
<Grid minColumnWidth={200} space="space-200">
{STEPS.map((step) => (
<Box key={step.title} padding="space-200" background="surface-sunken" radius="large">
<Stack space="space-050">
<Text weight="medium">{step.title}</Text>
<Text tone="subtle">{step.detail}</Text>
</Stack>
</Box>
))}
</Grid>
</Container>
</Section>
);
}import { Section, Container } from "@senvenli/react/layout";Examples
A call to action
A compact sunken band with a centered heading in a narrow container.import { Button } from "@senvenli/react/action";
import { Heading, Text } from "@senvenli/react/display";
import { Container, Stack, Section } from "@senvenli/react/layout";
export default function Example() {
return (
<Section tone="sunken" density="compact" aria-labelledby="start-title">
<Container width="narrow">
<Stack space="space-100" align="center">
<Heading id="start-title" level={2} size="heading-xxlarge">Start your first project</Heading>
<Text size="body-large" tone="subtle">Free for 14 days. No credit card needed.</Text>
</Stack>
<Stack direction="horizontal" space="space-100" justify="center">
<Button variant="primary">Start free trial</Button>
<Button variant="subtle">Talk to sales</Button>
</Stack>
</Container>
</Section>
);
}Guidelines
When to use it
- Building marketing or landing pages from stacked bands.
Accessibility
Built in
- A Section is a landmark; pass aria-labelledby with its heading's id to name it.
You provide
- Heading levels that follow the page outline.
API reference
Section
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | React.ReactNode | – | |
tone | "default" | "sunken" | "default" |
|
density | Density | "comfortable" | Vertical padding: ds-space-1000 from 768px and ds-space-600 below; |
id | string | – | Anchor target for the Navbar; scrolling to it leaves room for the 56px sticky Navbar. |
aria-labelledby | string | – | The id of the heading that names the band (a landmark needs a name to be listed). |
isProgressive | boolean | – | Skip painting until the band is near the viewport ( It also contains the band (layout, paint and style containment): overflowing children are clipped at its edge, and fixed or floating children position against it instead of the viewport. So a progressive band holds no fixed, floating or bleeding content (portal overlays and floating banners to <body>), and the first, above-the-fold band is never progressive. The 720px is a desktop-tuned estimate; once painted, the browser remembers the real height. |
childrenRequiredReact.ReactNodetone"default" | "sunken"Default"default"defaulton ds-surface;sunkenfor an alternate or CTA band. Never two sunken bands in a row.densityDensityDefault"comfortable"Vertical padding: ds-space-1000 from 768px and ds-space-600 below;
compactkeeps ds-space-600 throughout.idstringAnchor target for the Navbar; scrolling to it leaves room for the 56px sticky Navbar.
aria-labelledbystringThe id of the heading that names the band (a landmark needs a name to be listed).
isProgressivebooleanSkip painting until the band is near the viewport (
content-visibility: autowith a 720px intrinsic size): the content stays in the server HTML (find-in-page and anchors still work), nothing animates, and the reserved size keeps the layout from shifting.It also contains the band (layout, paint and style containment): overflowing children are clipped at its edge, and fixed or floating children position against it instead of the viewport. So a progressive band holds no fixed, floating or bleeding content (portal overlays and floating banners to <body>), and the first, above-the-fold band is never progressive. The 720px is a desktop-tuned estimate; once painted, the browser remembers the real height.
Container
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | React.ReactNode | – | |
width | "default" | "narrow" | "default" | 1200px (default) or 800px ( |
childrenRequiredReact.ReactNodewidth"default" | "narrow"Default"default"1200px (default) or 800px (
narrow) at most, centred.