# OverlayContext

`OverlayContext` is provided by [`OverlayProvider`](/chat/docs/sdk/react-native/v6/core-components/overlay-provider/) component. If you are not familiar with React Context API, please read about it on [React docs](https://reactjs.org/docs/context.html).

## Basic Usage

`OverlayContext` can be consumed by any of the child component of `OverlayProvider` component as following:

```tsx
import { useContext } from "react";
import { OverlayContext } from "stream-chat-react-native";

const { setOverlay } = useContext(OverlayContext);
```

Alternatively, you can also use `useOverlayContext` hook provided by library to consume OverlayContext.

```tsx
import { useOverlayContext } from "stream-chat-react-native";

const { setOverlay } = useOverlayContext();
```

## Value

### `overlay`

Current active overlay. Overlay gets rendered in following cases

- 'alert' - For delete message confirmation alert box
- 'gallery' - When image viewer/gallery is opened
- 'none' - Default value

| Type                             |
| -------------------------------- |
| enum('alert', 'gallery', 'none') |

### `setOverlay`

<partial id="chat-sdk/react-native/v6/_partials/common-content/contexts/overlay-context/set_overlay"></partial>

### `style`

A `theme` object to customize the styles of SDK components.
Detailed information on theming can be found in the [customization documentation](/chat/docs/sdk/react-native/v6/customization/theming/).

<admonition type="note">

Themes are inherited from parent providers.
A [theme provided to the `OverlayProvider`](/chat/docs/sdk/react-native/v6/core-components/overlay-provider#value/) will be the base theme `style` is merged into.
Themes are not hoisted though, therefore a theme provided to `Chat` will not change overlay components such as the attachment picker.

</admonition>

| Type   |
| ------ |
| Object |

---

This page was last updated at 2025-08-19T14:51:55.839Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/v6/contexts/overlay-context/](https://getstream.io/chat/docs/sdk/react-native/v6/contexts/overlay-context/).