# HeadingScope

> Establishes an ambient heading level read by nested headings and scopes, keeping a document outline sequential without passing a level by hand.

```ts
import { HeadingScope } from "@sdxc/ui";
```

Establishes an ambient heading level for descendants: an explicit `level`
fixes it, otherwise one level past the nearest ancestor HeadingScope,
read before this scope publishes its own depth, or `1` with no ancestor.

## Examples

```tsx
<HeadingScope>
	<Heading>Document title</Heading>
	<HeadingScope>
		<Heading>Section title</Heading>
	</HeadingScope>
</HeadingScope>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `level?` | `HeadingLevel` | Explicit semantic depth for this scope. Defaults to one level past the nearest ancestor scope's depth, or `1` where no scope wraps this one at all. |

Also accepts everything in `TagProps<"div">`.


## Also exported

- `readAmbientLevel`
- `resolveHeadingLevel`
