https://github.com/bamlab/react-native-hide-with-keyboard
Wrap around components to hide them if keyboard is up
https://github.com/bamlab/react-native-hide-with-keyboard
Last synced: 10 months ago
JSON representation
Wrap around components to hide them if keyboard is up
- Host: GitHub
- URL: https://github.com/bamlab/react-native-hide-with-keyboard
- Owner: bamlab
- License: mit
- Created: 2016-10-08T22:05:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T19:05:27.000Z (over 3 years ago)
- Last Synced: 2025-06-26T03:05:03.600Z (about 1 year ago)
- Language: JavaScript
- Size: 809 KB
- Stars: 124
- Watchers: 18
- Forks: 13
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hide Components when keyboard is shown
Devices screen are small especially when the keyboard takes half the space,
when you're working with forms for instance.
One of the best way to handle that is to hide part of the view when the keyboard
shows up.
## Install it
```
npm install -S react-native-hide-with-keyboard
```
## Use it
```javascript
import HideWithKeyboard from 'react-native-hide-with-keyboard';
...
render() {
return (
Hidden when keyboard is shown
Never hidden
)
}
```
### _Show_ components when keyboard is shown
In the case that you want to do the opposite, there is also `ShowWithKeyboard` which only shows a component when the keyboard is displayed. To use this, instead import `react-native-hide-with-keyboard` like so:
```javascript
import { HideWithKeyboard, ShowWithKeyboard } from 'react-native-hide-with-keyboard';
```