@fullstackcraft/react-native-keyboard-shift
Version:
A 2020s compatible keyboard avoiding view for Android and iOS that just works.
75 lines (48 loc) • 1.56 kB
Markdown
# react-native-keyboard-shift
[](https://github.com/FullStackCraft/react-native-keyboard-shift/blob/master/LICENSE) [](https://www.npmjs.com/package/@fullstackcraft/react-native-keyboard-shift) 
# Example
_Snack coming soon_
Until then:
1. Clone this repo:
```bash
git clone https://github.com/FullStackCraft/react-native-keyboard-shift
```
2. Move into the example folder:
```
cd react-native-keyboard-shift/example
```
3. Install dependencies:
```
npm install
```
4. Start Metro
```
npm start
```
5. Start Android or iOS
```bash
npm run android
# -or- iOS
npm run ios
```
Enjoy the juicy keyboard shifty-ness!
# Usage In Your Project
Install and save this package as a dependency:
```bash
npm install --save @fullstackcraft/react-native-keyboard-shift
```
Import and use the KeyboardShift component:
```tsx
import '@fullstackcraft/react-native-keyboard-shift'
// other imports
export default function YourCoolKeyboardScreen () {
// Other logic, variables, etc.
return (
<KeyboardShift>
{/* Screen components */}
</KeyboardShift>
)
}
```
# ANOTHER Keyboard Shifting Component?!
See the original [blog post](https://chrisfrewin.medium.com/a-keyboard-avoiding-view-for-react-native-in-2021-196701ff0608) that led to the creation of this library for more information.