---
id: "packages/active-geo/api/react"
title: "React"
description: "GeoMap, GeoMapProps, GeoDefaults, GeoDefaultsProps and 1 more: generated from the source of active-geo."
url: "/packages/active-geo/api/react"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:react"
---

# React

Exported by `@workspace/active-geo`. Generated from the package source; part of [the index of every export](/packages/active-geo/api).

## `GeoMap`

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `layers` | `readonly GeoLayer[]` | yes |  |
| `projection` | `GeoProjection` | yes |  |
| `title` | `string` | yes |  |
| `attribution` | `GeoAttribution` | no |  |
| `className` | `string` | no |  |
| `components` | `Resettable<GeoComponents>` | no |  |
| `contextMenu` | `FeatureOption<GeoContextMenuOptions>` | no |  |
| `dataset` | `GeoDatasetIdentity` | no |  |
| `defaultHighlight` | `GeoHighlight \| null` | no |  |
| `defaultSelectedItems` | `readonly GeoItemRef[]` | no |  |
| `defaultView` | `GeoView` | no |  |
| `description` | `string` | no |  |
| `diagnostics` | `GeoDiagnosticSink` | no | Where diagnostics go; default the console. |
| `export` | `GeoExportOptions` | no |  |
| `graticule` | `boolean` | no |  |
| `header` | `FeatureOption<GeoHeaderOptions>` | no |  |
| `height` | `number` | no | The stage height in CSS pixels (default 420); the width is measured. |
| `highlight` | `GeoHighlight \| null` | no |  |
| `home` | `GeoHome` | no |  |
| `legend` | `FeatureOption<GeoLegendOptions>` | no |  |
| `levelPath` | `readonly GeoLevel[]` | no |  |
| `locale` | `ValuePresentation` | no | The notation of numbers (BCP 47 tag or presentation); required somewhere. |
| `onExportComplete` | `((format: GeoExportFormat) => void)` | no |  |
| `onExportError` | `((format: GeoExportFormat, error: Error) => void)` | no |  |
| `onHighlightChange` | `((highlight: GeoHighlight \| null, change: GeoHighlightChange) => void)` | no |  |
| `onItemActivate` | `((item: GeoItem, source: "pointer" \| "keyboard" \| "touch") => void)` | no |  |
| `onLegendActivate` | `((activation: GeoLegendActivation) => void)` | no |  |
| `onLevelRequest` | `((request: GeoLevelRequest) => void \| Promise<void>)` | no |  |
| `onSelectionChange` | `((selection: GeoItemRef[], change: GeoSelectionChange) => void)` | no |  |
| `onTableRequest` | `((request: GeoTableRequest) => GeoTableRequestOutcome \| Promise<GeoTableRequestOutcome>)` | no |  |
| `onViewChange` | `((view: GeoView, change: GeoViewChange) => void)` | no |  |
| `ref` | `Ref<GeoMapHandle>` | no |  |
| `selectedItems` | `readonly GeoItemRef[]` | no |  |
| `selection` | `FeatureOption<GeoSelectionOptions>` | no |  |
| `subtitle` | `string` | no |  |
| `t` | `GeoTranslateFn` | no | The host's words for every key of the catalogue; required somewhere. |
| `table` | `FeatureOption<GeoTableOptions>` | no |  |
| `tooltip` | `FeatureOption<GeoTooltipOptions>` | no |  |
| `view` | `GeoView` | no |  |
| `zoom` | `FeatureOption<GeoZoomOptions>` | no |  |

## `GeoDefaults`

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | yes |  |
| `attribution` | `GeoAttribution` | no |  |
| `components` | `Resettable<GeoComponents>` | no |  |
| `contextMenu` | `FeatureOption<GeoContextMenuOptions>` | no |  |
| `diagnostics` | `GeoDiagnosticSink` | no | Where diagnostics go; default the console. |
| `export` | `GeoExportOptions` | no |  |
| `header` | `FeatureOption<GeoHeaderOptions>` | no |  |
| `legend` | `FeatureOption<GeoLegendOptions>` | no |  |
| `locale` | `ValuePresentation` | no | The notation of numbers (BCP 47 tag or presentation); required somewhere. |
| `selection` | `FeatureOption<GeoSelectionOptions>` | no |  |
| `t` | `GeoTranslateFn` | no | The host's words for every key of the catalogue; required somewhere. |
| `table` | `FeatureOption<GeoTableOptions>` | no |  |
| `tooltip` | `FeatureOption<GeoTooltipOptions>` | no |  |
| `zoom` | `FeatureOption<GeoZoomOptions>` | no |  |

## Functions, hooks and constants

**useGeoLegend**: `() => GeoLegendHook`

Returns an object with:

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `model` | `GeoLegendModel \| null` | yes |  |
| `activate` | `(entryId: string) => boolean` | yes |  |

## Types

**GeoMapProps**

```ts
interface GeoMapProps extends GeoConfigSource {
  readonly title: string;
  readonly subtitle?: string;
  readonly description?: string;
  readonly layers: readonly GeoLayer[];
  readonly projection: GeoProjection;
  readonly height?: number;
  readonly graticule?: boolean;
  readonly selectedItems?: readonly GeoItemRef[];
  readonly defaultSelectedItems?: readonly GeoItemRef[];
  readonly onSelectionChange?: (
    selection: GeoItemRef[],
    change: GeoSelectionChange,
  ) => void;
  readonly view?: GeoView;
  readonly defaultView?: GeoView;
  readonly home?: GeoHome;
  readonly onViewChange?: (view: GeoView, change: GeoViewChange) => void;
  readonly highlight?: GeoHighlight | null;
  readonly defaultHighlight?: GeoHighlight | null;
  readonly onHighlightChange?: (
    highlight: GeoHighlight | null,
    change: GeoHighlightChange,
  ) => void;
  readonly onLegendActivate?: (activation: GeoLegendActivation) => void;
  readonly onItemActivate?: (
    item: GeoItem,
    source: 'pointer' | 'keyboard' | 'touch',
  ) => void;
  readonly onTableRequest?: (
    request: GeoTableRequest,
  ) => GeoTableRequestOutcome | Promise<GeoTableRequestOutcome>;
  readonly dataset?: GeoDatasetIdentity;
  readonly levelPath?: readonly GeoLevel[];
  readonly onLevelRequest?: (request: GeoLevelRequest) => void | Promise<void>;
  readonly onExportComplete?: (format: GeoExportFormat) => void;
  readonly onExportError?: (format: GeoExportFormat, error: Error) => void;
  readonly ref?: Ref<GeoMapHandle>;
  readonly className?: string;
}
```

**GeoDefaultsProps**

```ts
interface GeoDefaultsProps extends GeoConfigSource {
  readonly children: ReactNode;
}
```
