New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-keyboard-controller

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-keyboard-controller

Platform agnostic keyboard manager

  • 1.0.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59K
decreased by-45.71%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android.

Note: This library is still in development and in alpha stage. So most likely it has bugs/issues - don't hesitate to report if you find them 🙂.

Demonstration

  • mapping keyboard appearance to animated values 😎
  • missing keyboardWillShow/keyboardWillHide events are available on Android 😍
  • module for changing soft input mode on Android 🤔
  • reanimated support 🚀
  • interactive keyboard dismissing (planned) 👆📱
  • and more is coming... Stay tuned! 😊

Installation

Install react-native-keyboard-controller package from npm:

yarn add react-native-keyboard-controller

# or
# npm install react-native-keyboard-controller --save

Usage

For more comprehensive usage you can have a look on example.

Below you can see a short overview of library API:

import {
  KeyboardProvider,
  useKeyboardAnimation,
} from 'react-native-keyboard-controller';

// 1. wrap your app in Provider
<KeyboardProvider>
  <AppContainer />
</KeyboardProvider>

// 2. get animation values where you need them
const { height, progress } = useKeyboardAnimation();

// 3. Animate any elements as you wish :)
<Animated.View
  style={{
    width: 50,
    height: 50,
    backgroundColor: 'red',
    borderRadius: 25,
    // the element will move up with the keyboard
    transform: [{ translateY: height }],
  }}
/>
<Animated.View
  style={{
    width: 50,
    height: 50,
    backgroundColor: 'green',
    borderRadius: 25,
    transform: [
      {
        // or use custom interpolation using `progress`
        translateX: progress.interpolate({
          inputRange: [0, 1],
          outputRange: [0, 100],
        }),
      },
    ],
  }}
/>

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Package last updated on 01 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc