# Section

A semantic vertical region with responsive spacing and padding.

`Section` creates a semantic vertical region with responsive internal rhythm. It renders a native `section` by default and remains visually neutral until the consumer adds surface styles.

```tsx
import { Badge, Cluster, Section, Text } from "@zentara-co/zenos-ui";

function SectionExample() {
  return (
    <Section
      aria-labelledby="security-overview"
      gap="3"
      padding={{ base: "4", md: "6" }}
      className="w-full max-w-2xl rounded-xl border border-border bg-background-neutral-card"
    >
      <Text id="security-overview" type="heading" size="h5">
        Security overview
      </Text>
      <Text color="subtle">Review the latest workspace posture and outstanding findings.</Text>
      <Cluster gap="2">
        <Badge variant="default" color="success">
          18 resolved
        </Badge>
        <Badge variant="default" color="warning">
          4 need review
        </Badge>
      </Cluster>
    </Section>
  );
}
```

## Import

```tsx
import { Section } from "@zentara-co/zenos-ui";
```

## Responsive spacing

`gap`, `padding`, `paddingX`, and `paddingY` use the shared responsive spacing scale. Specific axis props can refine the general padding value.

```tsx
import { Section, Stack, Text } from "@zentara-co/zenos-ui";

function SectionSpacingExample() {
  return (
    <Stack gap="4" className="w-full">
      <Section
        gap="2"
        paddingX={{ base: "3", md: "6" }}
        paddingY={{ base: "4", md: "8" }}
        className="rounded-xl border border-border bg-background-neutral-card"
      >
        <Text type="heading" size="h6">
          Responsive spacing
        </Text>
        <Text color="subtle">Inline and block padding grow independently at md.</Text>
      </Section>
      <Section
        as="article"
        gap="3"
        padding="4"
        aria-labelledby="incident-section-title"
        className="rounded-xl border border-border bg-background-neutral-card"
      >
        <Text id="incident-section-title" type="heading" size="h6">
          Semantic article
        </Text>
        <Text color="subtle">The selected element determines the document semantics.</Text>
      </Section>
    </Stack>
  );
}
```

A section should usually have an accessible heading. When the region is purely structural and has no heading, use `as="div"` or another element that matches its role.

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | section | Rendered semantic element. |
| gap | Responsive<Spacing> | — | Space between section children. |
| padding / paddingX / paddingY | Responsive<Spacing> | — | Responsive section padding. |
| native props | React.HTMLAttributes<HTMLElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Native `section` elements become useful landmarks when they have an accessible name, commonly through a visible heading and `aria-labelledby`. Avoid creating many unnamed section landmarks solely for spacing.

Source: https://zenos-ui.pages.dev/layout/section/