### Install Keyboard Avoider (Yarn) Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Installs the @good-react-native/keyboard-avoider package using Yarn. ```sh yarn add @good-react-native/keyboard-avoider ``` -------------------------------- ### Install Cocoapods for iOS Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Installs necessary dependencies for iOS using Cocoapods. ```sh cd ios && pod install ``` -------------------------------- ### react-native-keyboard-avoider Working Example Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Presents a functional example using react-native-keyboard-avoider's KeyboardAvoiderView. This component reliably avoids the keyboard by using translations, ensuring a smooth user experience across different layouts. ```jsx export function ReactNativeFixedExample() { return ( ) } ``` -------------------------------- ### Install React Native Reanimated (Expo) Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Installs the react-native-reanimated library for Expo projects. ```sh expo install react-native-reanimated ``` -------------------------------- ### Install Keyboard Avoider and Reanimated (Non-Expo) Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Installs both the keyboard-avoider and react-native-reanimated packages for non-Expo projects. ```sh yarn add @good-react-native/keyboard-avoider react-native-reanimated ``` -------------------------------- ### React Native KeyboardAvoidingView Example (Fails) Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Demonstrates a common scenario where React Native's built-in KeyboardAvoidingView fails to properly avoid the keyboard, even with its 'padding' behavior. This highlights the limitations of the default component. ```jsx function DoesntWork() { return ( ) } ``` -------------------------------- ### Basic KeyboardAvoiderView Usage Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Demonstrates the basic usage of KeyboardAvoiderView to avoid keyboard interference. ```jsx export const MyScreen = () => ( ); ``` -------------------------------- ### Configure Android Manifest for adjustPan Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Sets the windowSoftInputMode to adjustPan in the AndroidManifest.xml for bare workflow projects. ```xml ``` -------------------------------- ### Common Props for Keyboard Avoiders Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Common props supported by all keyboard avoider components, including animation and spacing configurations. ```APIDOC Common Props: animationTime: number Time to move the view out of the way when the keyboard opens. Default: 150 animationEasing: Animated.EasingFunction Easing function to use for both opening and closing animation. Opening and closing animations will both use Easing.out(animationEasing). Default: Easing.quad extraSpace: number How much space there should be between the keyboard avoiding element and the keyboard. Default: 20 ``` -------------------------------- ### Wrap App with KeyboardAvoiderProvider Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Wraps the root component of the React Native application with KeyboardAvoiderProvider. ```jsx export const App = () => ( ); ``` -------------------------------- ### Configure app.json for Android adjustPan (Expo) Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Configures the softwareKeyboardLayoutMode to 'pan' in app.json for Expo projects. ```json "expo": { "android": { "softwareKeyboardLayoutMode": "pan" } } ``` -------------------------------- ### KeyboardAvoiderInsets Props Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Props for the KeyboardAvoiderInsets component, which supports all common props. ```APIDOC KeyboardAvoiderInsets Props: Supports all common props. ``` -------------------------------- ### Configure Babel for Reanimated (Non-Expo) Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Adds the react-native-reanimated Babel plugin to babel.config.js for non-Expo projects. ```javascript module.exports = { presets: [ ... ], plugins: [ ... 'react-native-reanimated/plugin', ], }; ``` -------------------------------- ### KeyboardAvoiderView Props Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Props for the KeyboardAvoiderView component, including common props and specific props like avoidMode and enableAndroid. ```APIDOC KeyboardAvoiderView Props: Supports all React Native View props and common props. Additionally, it supports: avoidMode: 'whole-view' | 'focused-input' Which avoid mode to use. 'whole-view' will move the entire view out of the way. 'focused-input' will move just enough to show the input plus the extra space. Default: 'whole-view' enableAndroid: boolean Enable keyboard avoiding on Android. Default: true ``` -------------------------------- ### KeyboardAvoiderScrollView Usage Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Shows how to use KeyboardAvoiderScrollView for a responsive and predictable scroll behavior. ```jsx export const MyScreen = () => ( ); ``` -------------------------------- ### KeyboardAvoiderInsets Usage Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Utilizes KeyboardAvoiderInsets to create space within a layout when the keyboard appears, useful for docked keyboards. ```jsx export const MyScreen = () => ( ); ``` -------------------------------- ### Section Based Scrolling with KeyboardAvoiderScrollSection Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Implements section-based scrolling where an entire section is shown when any input within it is focused. ```jsx export const MyScreen = () => ( ); ``` -------------------------------- ### KeyboardAvoiderScrollView Props Source: https://github.com/iway1/react-native-keyboard-avoider/blob/master/README.md Props for the KeyboardAvoiderScrollView component, including common props and specific props like iosHideBehavior. ```APIDOC KeyboardAvoiderScrollView Props: Supports all React Native ScrollView props and common props. Additionally, it supports: iosHideBehavior: 'stay' | 'revert' Behavior when the keyboard hides on iOS. 'stay' makes it where the scroll view stays where it is when the keyboard closes. 'revert' makes it where the scroll view returns to its original position. Default: 'stay' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.