React Native Keyboard Handling logo

React Native Keyboard Handling

Community
bidah
react-native-keyboard-handling

Implement frame-perfect, native-feeling keyboard handling in React Native and Expo apps. Use when content is covered by the keyboard, when keyboard animations jank or "snap" on Android, when inputs are hidden behind the keyboard, when the keyboard covers fields on Android 15 / edge-to-edge even though older Android worked, or when building forms, sticky footers, or chat input bars that must track the keyboard. Triggers: "keyboard covers input", "KeyboardAvoidingView not working on Android", "keyboard animation janky", "keyboard sticky footer", "Android 15 keyboard", "edge-to-edge keyboard", react-native-keyboard-controller.

Overview

Publisherbidah
Repositoryskill-set
Skill namereact-native-keyboard-handling
Stars
276
Forks
32
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by bidah on GitHub. Read the source before you install it.

Installation

Install the React Native Keyboard Handling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/bidah/skill-set/tree/main/skills/react-native-keyboard-handling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bidah/skill-set.git /tmp/skill-set
mkdir -p .claude/skills
cp -r /tmp/skill-set/skills/react-native-keyboard-handling .claude/skills/react-native-keyboard-handling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable React Native Keyboard Handling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads React Native Keyboard Handling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so React Native Keyboard Handling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

React Native Keyboard Handling

Make the keyboard feel native on both platforms by mapping two fundamentally different OS keyboard models onto one animated value that your UI binds to.

The core mental model (read this first)

iOS and Android expose the keyboard in incompatible ways. Most "broken keyboard" bugs come from ignoring this asymmetry.

  • iOS = scheduled animation. The OS tells you up front: "the keyboard will slide from A to B over 0.25s with this easing curve." You get two snapshots (start/end) plus duration and curve — not intermediate frames. UIKit interpolates for you.
  • Android (modern, edge-to-edge) = per-frame insets. The IME is just another system window. You get a firehose of frames, one inset value per frame, and you drive the animation yourself.

Anything that ignores this asymmetry will feel broken. The fix is to map both models onto a single shared animated value, then have every consumer (padded container, translated footer, scroll offset) bind to that one value and stop caring which platform feeds it.

Decision guide — which tool to reach for

SituationUse
Whole screen / single input should stay above keyboardKeyboardAvoidingView (from react-native-keyboard-controller)
Scrollable form with multiple inputsKeyboardAwareScrollView
One element pinned above the keyboard (footer, send bar, toolbar)KeyboardStickyView
Fully custom animation tied to keyboard positionuseReanimatedKeyboardAnimation() / useKeyboardHandler() + Reanimated SharedValue

Default recommendation: use react-native-keyboard-controller, not React Native's built-in KeyboardAvoidingView. The built-in version relies on LayoutAnimation and the late keyboardDidShow event, which has no per-frame Android primitive — so Android content snaps instead of sliding and the timing never matches the keyboard curve.

Setup

  1. Install the library and its peer deps:
    bash
    npm install react-native-keyboard-controller react-native-reanimated
  2. Wrap your app root once in KeyboardProvider. This installs the native WindowInsetsAnimationCallback subscription on Android and handles edge-to-edge automatically:
    tsx
    import { KeyboardProvider } from "react-native-keyboard-controller";
    
    export default function App() {
      return (
        <KeyboardProvider>
          {/* ...rest of the app */}
        </KeyboardProvider>
      );
    }

Patterns

Single input / simple screen — drop-in replacement

Same API as RN's KeyboardAvoidingView; swapping the import alone fixes the Android timing/snap problems.

tsx
import { KeyboardAvoidingView } from "react-native-keyboard-controller";

<KeyboardAvoidingView behavior="padding" style={{ flex: 1 }}>
  {/* input(s) */}
</KeyboardAvoidingView>

Scrollable form — track the focused input

Auto-scrolls the minimum distance to keep the focused input (and caret/selection) above the keyboard, using the same curve as the keyboard motion. bottomOffset adds breathing room between the input and the keyboard top.

tsx
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";

<KeyboardAwareScrollView bottomOffset={50} style={{ flex: 1 }}>
  <TextInput placeholder="Field 1" />
  <TextInput placeholder="Field 2" />
  {/* more inputs */}
</KeyboardAwareScrollView>

Sticky footer / send bar — translate one element only

Translates a single element instead of recomputing flex layout for the whole screen. offset controls the gap when the keyboard is open vs closed.

tsx
import { KeyboardStickyView } from "react-native-keyboard-controller";

<KeyboardStickyView offset={{ closed: 0, opened: 20 }}>
  <Footer />
</KeyboardStickyView>

Custom animation — bind to the shared keyboard value

For fully bespoke motion, read the keyboard height as a Reanimated SharedValue and drive any style from it. Works identically on both platforms because the library already merged the two OS models into this one value.

tsx
import { useReanimatedKeyboardAnimation } from "react-native-keyboard-controller";
import Animated, { useAnimatedStyle } from "react-native-reanimated";

const { height } = useReanimatedKeyboardAnimation(); // SharedValue, per-frame
const style = useAnimatedStyle(() => ({
  transform: [{ translateY: height.value }],
}));

<Animated.View style={style}>{/* ... */}</Animated.View>;

Pitfalls & gotchas

  • Android 15 / SDK 35 covers your inputs. Edge-to-edge is forced by default from Android 15 (API 35). The system no longer resizes the window when the keyboard appears, so the old adjustResize / windowSoftInputMode contract silently breaks — inputs get covered even though the exact same code worked on Android 14. KeyboardProvider handles edge-to-edge for you; don't rely on adjustResize.
  • will* events never fire on Android. keyboardWillShow / keyboardWillHide have no underlying Android primitive, and keyboardDidShow fires after the animation finishes — too late to animate in sync. Don't build animations on the raw Keyboard event listeners for Android.
  • Stock KeyboardAvoidingView + Android = snap, not slide. It uses LayoutAnimation, whose timing doesn't match the keyboard curve on Android, so motion looks janky. Prefer the keyboard-controller version.
  • Version fragmentation is real. Behavior that "works" on Android 10 can break differently on Android 11 and again on Android 15. Use a library that abstracts the OS differences instead of hand-rolling per-version logic.
  • Wrong component for the job. Using KeyboardAvoidingView for a multi-input form won't track which input is focused, so the caret can stay hidden — use KeyboardAwareScrollView. Using it to move a single footer forces an unnecessary full-screen layout recompute — use KeyboardStickyView.

Why the asymmetry exists (native reference)

Useful when debugging at the native layer or explaining the design.

  • iOS surface: NotificationCenter keyboard notifications carry keyboardFrameEndUserInfoKey (final frame), keyboardAnimationDurationUserInfoKey (timing), and keyboardAnimationCurveUserInfoKey (a private curve, UIView.AnimationCurve(rawValue: 7)). Two snapshots, not frames.
  • Android surface: WindowInsetsAnimationCallback with four hooks — onPrepare(), onStart(insets), onProgress(insets, runningAnimations) (fires every frame), onEnd(). The library subscribes here and writes each frame's inset into the shared value; on Android 11 it polyfills the per-frame stream where native support is missing.

Source

Based on Margelo's The Go-To Guide for Understanding Keyboards in React Native (Part 1): https://blog.margelo.com/deep-dive-in-keyboard-handling

Frequently asked questions

What does the React Native Keyboard Handling AI skill do?

Implement frame-perfect, native-feeling keyboard handling in React Native and Expo apps. Use when content is covered by the keyboard, when keyboard animations jank or "snap" on Android, when inputs are hidden behind the keyboard, when the keyboard covers fields on Android 15 / edge-to-edge even though older Android worked, or when building forms, sticky footers, or chat input bars that must track the keyboard. Triggers: "keyboard covers input", "KeyboardAvoidingView not working on Android", "keyboard animation janky", "keyboard sticky footer", "Android 15 keyboard", "edge-to-edge keyboard",...

Why use React Native Keyboard Handling on TypingMind?

Because you install it once and use it with any model. React Native Keyboard Handling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install React Native Keyboard Handling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/bidah/skill-set/tree/main/skills/react-native-keyboard-handling. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use React Native Keyboard Handling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with React Native Keyboard Handling?

As many as you like. As long as a model supports skills, you can use React Native Keyboard Handling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the React Native Keyboard Handling AI skill free?

It is published on GitHub by bidah. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇