<!-- Generated by scripts/gen-docs.mts from the JSDoc in registry/. Do not edit; run `pnpm run docs`. -->

# PageSection

One section of a page: generous space above and below, and a hairline on top that separates it from the one before. Put sections inside a `PageShell`.

```tsx
import { PageSection } from "@/components/ouro/page-shell/page-shell";
```

## Example

```tsx
<PageSection aria-labelledby="work">
  <h2 id="work">Work</h2>
</PageSection>
```

## Use instead when

- Use `Card` instead for a boxed block of content, and `Separator` for a rule on its own.

## Props

Type: `PageSectionProps`.

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` | Layout only: margins, grid placement. Appearance classes warn in development. |
| `ref` | `Ref<HTMLElement>` | Reaches the rendered element. |

## Native attributes

Also accepts the attributes in React's `HTMLAttributes` (`id`, `aria-*`, event handlers), passed to the rendered element, except those named on this page.

## `className` is for layout only

Pass margins, width and grid placement (`mt-4`, `w-full`, `col-span-2`). Your classes always win over Ouro UI's: PageSection merges `className` last with `cn` (tailwind-merge), so a class that conflicts with its own replaces it.[^layout-classes]

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (`hover:`, `sm:`) and any `!` are removed, it starts with `bg-`, `text-`, `border-`, `rounded-`, `shadow-`, `font-`, `ring-`, `from-`, `via-`, `to-`, `fill-` or `stroke-`, or is `border`, `rounded`, `shadow` or `ring`, or has a `dark:` variant. Text wrapping, overflow and table layout classes (`text-wrap`, `text-ellipsis`, `border-collapse`) are layout and do not warn.

Alignment classes (`text-center`) warn too: set alignment on a parent element.

[^layout-classes]: test:registry/ouro/components/ouro/page-shell/page-shell.test.tsx::PageShell > lets the app's layout class win and warns about an appearance class verify:testExists(registry/ouro/components/ouro/page-shell/page-shell.test.tsx::PageShell > lets the app's layout class win and warns about an appearance class)
