# LayersSectionProps

Props for [`LayersSection`](https://docs.mapcairn.com/api/map/LayersSection.md).

This is an interface exported by `@mapcairn/map`, checked against version 0.2.0.

## Signature

```ts
import type { LayersSectionProps } from "@mapcairn/map";
 
interface LayersSectionProps
```

## Properties

### formatters

```ts
readonly formatters?: FormatterRegistry;
```

The formatters card and list templates may name. Defaults to the built-ins.

### headingLevel

```ts
readonly headingLevel?: HeadingLevel;
```

The heading level. Defaults to 3, below the sheet's h2 title.

### headingRef

```ts
readonly headingRef?: Ref<HTMLHeadingElement>;
```

Receives the heading element, so the sheet can move focus to the section it opens on.

### intro

```ts
readonly intro?: string;
```

The line above the layers, in place of the catalogue's `layers.intro` ("Open
data from public providers. Nothing is requested until you turn a layer
on."), which is not true of every host (one behind a login serves its own
data). An empty string leaves the line out.

### layers

```ts
readonly layers: DataLayers;
```

The layers state the section lists and changes.

### onShowOnMap

```ts
readonly onShowOnMap?: () => void;
```

Called after "Show on map" has centred a feature, so the host can make
room for the map: the section keeps the feature clear of the sheet at
`REVEAL_DETENT`, so the host should bring the sheet to that detent.

### showTurnOffAll

```ts
readonly showTurnOffAll?: boolean;
```

Whether the section offers "Turn off all layers", the action for each
group and the Undo that follows. Defaults to true; a host that does not
want them passes false.

## See also

- [`FormatterRegistry`](https://docs.mapcairn.com/api/core/FormatterRegistry.md)
- [`HeadingLevel`](https://docs.mapcairn.com/api/map/HeadingLevel.md)
- [`DataLayers`](https://docs.mapcairn.com/api/map/DataLayers.md)

Source: [packages/map/src/layers/LayersSection.tsx:68](https://github.com/MapCairn/mapcairn/blob/main/packages/map/src/layers/LayersSection.tsx#L68)
