@molecule/app-keyboard-react-native
Provider bond · keyboard · App (browser) · v1.0.2 · Apache-2.0
React Native keyboard provider
npm install @molecule/app-keyboard-react-nativenpm · Source on GitHub · Implements @molecule/app-keyboard
How it works
@molecule/app-keyboard-react-native is a provider bond on the app (browser) side: it implements the keyboard core interface (@molecule/app-keyboard) with a concrete vendor or library behind it.
Your code calls the core; you wire this provider once at startup. Swapping vendors later is one line in that wiring, not a rewrite.
import { setProvider } from '@molecule/app-keyboard'
import { provider } from '@molecule/app-keyboard-react-native'
setProvider(provider) // once, at app startupReference
React Native keyboard provider for molecule.dev.
Uses react-native's Keyboard/Dimensions to implement the
KeyboardProvider interface from @molecule/app-keyboard: dismiss,
visibility + height state, and show/hide events.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
import { setProvider } from '@molecule/app-keyboard'
import { provider } from '@molecule/app-keyboard-react-native'
setProvider(provider) // once, at app startup
Type
provider
Installation
npm install @molecule/app-keyboard-react-native @molecule/app-i18n @molecule/app-keyboard @molecule/app-logger react-native
API
Functions
createReactNativeKeyboardProvider()
Creates a React Native keyboard provider backed by react-native Keyboard.
function createReactNativeKeyboardProvider(): KeyboardProvider
Returns: A KeyboardProvider implementation for React Native.
Constants
provider
Default React Native keyboard provider.
const provider: KeyboardProvider
Core Interface
Implements @molecule/app-keyboard interface.
Bond Wiring
Setup function to register this provider with the core interface:
import { setProvider } from '@molecule/app-keyboard'
import { provider } from '@molecule/app-keyboard-react-native'
export function setupNativeKeyboardReactNative(): void {
setProvider(provider)
}
Injection Notes
Requirements
Peer dependencies:
@molecule/app-i18n^1.0.1@molecule/app-keyboard^1.0.1@molecule/app-logger^1.0.1react-native>=0.72.0
Runtime Dependencies
-
@molecule/app-i18n -
@molecule/app-keyboard -
@molecule/app-logger -
react-native -
show()is a no-op andtoggle()can only hide — React Native cannot open the keyboard programmatically; focus aTextInputinstead.hide()works (Keyboard.dismiss()). -
setResizeMode/setStyle/setAccessoryBar/setScrollare no-ops in this bond — resize is configured in AndroidManifest.xml / app.json, scroll viaKeyboardAvoidingView.getCapabilities()reports all fourfalse; feature-gate on it rather than assuming the calls did something. -
Requires the
react-nativepeer; it is imported lazily and a missing install surfaces as a descriptive error on first use.
Translations
Translation strings are provided by @molecule/app-locales-keyboard.