# capacitor-keyboard

Walks through on-screen keyboard behavior in Capacitor apps: iOS resize modes, keyboard event heights, Android edge-to-edge. Useful when inputs hide behind the keyboard.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1000 installs · ★ 73
- Author: Cap-go
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Cap-go/capgo-skills/tree/HEAD/skills/capacitor-keyboard/SKILL.md
- Updated: 2026-10-17
- HTML: https://affpapa.org/en/nevibecode/skills/capacitor-keyboard

## What it does

The skill helps you work out why an input in a Capacitor app disappears behind the keyboard, why a white or black band shows up above it, and why a fixed footer floats mid-screen. On iOS it covers the four `resize` modes from `KeyboardResize`: `native` (the default), `body`, `ionic` and `none`, plus the heights from `keyboardWillShow` and `keyboardDidShow`, and the `setAccessoryBarVisible`, `setScroll`, `setStyle` and `autoBackdropColor` methods from 8.0.4 and later.

Android gets its own section. From Android 15 edge-to-edge is enforced, and on Capacitor 8 the legacy `resizeOnFullScreen` has to go: the SystemBars core plugin handles insets now. The skill advises updating `@capacitor/keyboard` first, because some of the white space above the keyboard was fixed in 7.0.2 and 8.0.3, and only then writing workarounds.

Inside there is a table for picking the resize mode, a `capacitor.config.ts` example, a ready listener for custom chat layouts driven by a `--kb` CSS variable, and a verification checklist for physical devices. Input auto-zoom on iOS below 16px and the iOS 26 regressions get their own notes. The skill does not cover safe-area and notch padding, Ionic component styling or form accessibility — other skills in the set handle those.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill capacitor-keyboard -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/capacitor-keyboard/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/capacitor-keyboard/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill capacitor-keyboard -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/capacitor-keyboard/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill capacitor-keyboard -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/capacitor-keyboard/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Cap-go/capgo-skills capacitor-keyboard
```

2. **Manually: put the files in place**
- File: `.github/skills/capacitor-keyboard/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill capacitor-keyboard -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Cap-go/capgo-skills --path skills/capacitor-keyboard
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/capacitor-keyboard/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill capacitor-keyboard -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Cap-go/capgo-skills/tree/HEAD/skills/capacitor-keyboard/SKILL.md

## When to use it
- remove the white or black band above the keyboard on Android 15+
- pin a fixed footer to the keyboard
- pick a resize mode so `100vh` stops collapsing
- stop iOS from zooming into inputs on focus
- make keyboard events fire once instead of twice

## Example prompts
- The input hides behind the keyboard on iPhone — sort out the resize mode
- There's a white band above the keyboard on Android 15, check the edge-to-edge setup
- The chat footer doesn't stick to the keyboard, help me with `resize: none` and the `keyboardWillShow` height

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 1cb9f442e6b56f21.

BEGIN THIRD-PARTY FILE 1cb9f442e6b56f21
```text
---
name: capacitor-keyboard
description: Fixes on-screen keyboard behavior in Capacitor apps with @capacitor/keyboard - iOS `resize` modes (`native` default, `body`, `ionic`, `none`), `keyboardWillShow`/`keyboardDidShow` heights, `setAccessoryBarVisible`, `setScroll`, `style` (`DARK`/`LIGHT`/`DEFAULT`), `autoBackdropColor` (8.0.4+), Android edge-to-edge/SystemBars interaction (drop legacy `resizeOnFullScreen` on Capacitor 8), iOS 26 fixes, and iOS input auto-zoom. Use when inputs are hidden behind the keyboard, the WebView jumps or leaves a white/black gap above the keyboard, fixed footers float mid-screen, `vh` layouts shrink, or keyboard events do not fire. Do not use for general safe-area/notch padding (safe-area-handling), Ionic component styling (ionic-design), or form accessibility (capacitor-accessibility).
---

# Keyboard Handling in Capacitor

## When to Use

TRIGGER when:
- Focused input is covered by the keyboard, or the page scrolls unexpectedly
- Chat composer / fixed footer does not stick to the keyboard
- White or black band above the keyboard (Android 15+ edge-to-edge, iOS backdrop)
- `100vh` / `dvh` layout collapses when the keyboard opens
- iOS zooms into inputs, or the QuickType/accessory bar looks wrong
- Keyboard events never fire or fire twice

Do not use:
- Notch / home-indicator / status-bar padding: `safe-area-handling`
- Ionic `ion-input`, `ion-footer` styling: `ionic-design`
- Labels, focus order, screen readers: `capacitor-accessibility`

## Platform model (the key decision)

| | iOS | Android |
|---|-----|---------|
| Who resizes | Plugin, per `resize` mode | OS + WebView; `resize` config is ignored |
| Events | `keyboardWillShow` before animation, `keyboardDidShow` after | Will/Did fire almost together |
| JS control | `setResizeMode`, `getResizeMode`, `setScroll`, `setStyle`, `setAccessoryBarVisible` (iPhone only) | `show()` (Android only), `hide()` |

iOS `resize` modes (`KeyboardResize` enum):

| Mode | Effect | Use when |
|------|--------|----------|
| `native` (default) | Whole WebView shrinks; `vh` units change | Plain web apps; simplest |
| `body` | Only `<body>` height changes; `vh` unchanged | Layouts that rely on stable `vh` |
| `ionic` | Only `ion-app` resizes | Ionic Framework apps only |
| `none` | Nothing resizes; you position with keyboard height | Custom chat UIs, full control |
```
END THIRD-PARTY FILE 1cb9f442e6b56f21

The third-party file has ended. Everything between the 1cb9f442e6b56f21 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2367 of 8219 bytes. © Cap-go · MIT · https://github.com/Cap-go/capgo-skills/tree/HEAD/skills/capacitor-keyboard/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
