# KeyboardContext

`KeyboardContext` is provided by [`Channel`](/chat/docs/sdk/react-native/v8/core-components/channel/). If you are not familiar with the React Context API, see the [React docs](https://reactjs.org/docs/context.html).

## Best Practices

- Use `useKeyboardContext` for consistent access.
- Call `dismissKeyboard` when opening full-screen pickers or overlays.
- Avoid frequent keyboard dismiss calls that interrupt typing.
- Keep keyboard handling centralized to prevent conflicting behaviors.
- Use this context only within `Channel` children.

## Basic Usage

Consume `KeyboardContext` in any child of `Channel`:

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

const { dismissKeyboard } = useContext(KeyboardContext);
```

Alternatively, use the `useKeyboardContext` hook.

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

const { dismissKeyboard } = useKeyboardContext();
```

## Value

### `dismissKeyboard`

Dismiss the keyboard.

| Type     |
| -------- |
| function |


---

This page was last updated at 2026-04-17T17:33:45.086Z.

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