# Section

Full-width page bands with a centered container; the heading that names a band is yours.

- Family: layout
- Import: `import { Section, Container } from "@senvenli/react/layout";`
- Page: https://design.senvenli.com/docs/components/section
- JSON: https://design.senvenli.com/docs/components/section.json

## Example: A page band

A Section, its Container, and the heading that names it (`aria-labelledby`).

```tsx
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>
  );
}
```

## Examples

### A call to action

A compact sunken band with a centered heading in a narrow container.

```tsx
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.

### Use something else when

- [box](https://design.senvenli.com/docs/components/box.md): A padded surface inside a page, not a full-width band.
- [card](https://design.senvenli.com/docs/components/card.md): The group is about one object.

## 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 | Required | Description |
| --- | --- | --- | --- | --- |
| children | `React.ReactNode` |  | yes |  |
| tone | `"default" \| "sunken"` | `"default"` | no | `default` on ds-surface; `sunken` for an alternate or CTA band. Never two sunken bands in a row. |
| density | `Density` | `"comfortable"` | no | Vertical padding: ds-space-1000 from 768px and ds-space-600 below; `compact` keeps ds-space-600 throughout. |
| id | `string` |  | no | Anchor target for the Navbar; scrolling to it leaves room for the 56px sticky Navbar. |
| aria-labelledby | `string` |  | no | The id of the heading that names the band (a landmark needs a name to be listed). |
| isProgressive | `boolean` |  | no | Skip painting until the band is near the viewport (`content-visibility: auto` with 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 | Required | Description |
| --- | --- | --- | --- | --- |
| children | `React.ReactNode` |  | yes |  |
| width | `"default" \| "narrow"` | `"default"` | no | 1200px (default) or 800px (`narrow`) at most, centred. |

### Tokens it reads

`--ds-space-100`, `--ds-space-1000`, `--ds-space-200`, `--ds-space-300`, `--ds-space-400`, `--ds-space-600`, `--ds-surface`, `--ds-surface-sunken`, `--ds-text`

## Related

- [heading](https://design.senvenli.com/docs/components/heading.md)
