All Projects → just4fun → react-native-sticky-keyboard-accessory

just4fun / react-native-sticky-keyboard-accessory

Licence: MIT license
📎 A sticky wrapper above keyboard to include whatever you want.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-sticky-keyboard-accessory

unigem-objective-c
Unicode Gems, a Mac app, an iOS app, and an iOS keyboard for letter-like unicode.
Stars: ✭ 22 (+0%)
Mutual labels:  keyboard
kinesis-advantage-2
Keyboard layouts and macros for the Kinesis Advantage 2 keyboard.
Stars: ✭ 72 (+227.27%)
Mutual labels:  keyboard
masterkeys-linux
MasterKeys SDK for Linux
Stars: ✭ 22 (+0%)
Mutual labels:  keyboard
react-native-screen-keyboard
On-screen keyboard with customisable keys and tactile / UI feedback 📱
Stars: ✭ 22 (+0%)
Mutual labels:  keyboard
dasher-web
Dasher text entry in HTML, CSS, JavaScript, and SVG
Stars: ✭ 34 (+54.55%)
Mutual labels:  keyboard
habits
An application to monitor your habits with your PC. So you can study how many kilometers travel with your mouse or how many keystrokes.
Stars: ✭ 19 (-13.64%)
Mutual labels:  keyboard
Kimiko
Build-Guide for the Kimiko Split-Keyboard pcb.
Stars: ✭ 34 (+54.55%)
Mutual labels:  keyboard
keyboard-layouter
Footprint auto placement plugin for keyboard layout
Stars: ✭ 73 (+231.82%)
Mutual labels:  keyboard
nativescript-numeric-keyboard
🔢 Replace the meh default number/phone keyboard with this stylish one
Stars: ✭ 33 (+50%)
Mutual labels:  keyboard
PianoView
Fully custumisable piano keyboard view with IBDesignable properties in swift
Stars: ✭ 34 (+54.55%)
Mutual labels:  keyboard
keyboard-css
Show off your keyboard shortcuts with style 🦄.
Stars: ✭ 52 (+136.36%)
Mutual labels:  keyboard
KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (+90.91%)
Mutual labels:  keyboard
DialogUi
关于toast、等待框、对话框、选择框、地址选择框、软键盘等工具的封装
Stars: ✭ 49 (+122.73%)
Mutual labels:  keyboard
ck550-macos
MacOS effect control SW for a CoolMaster CK550 & CK530 Keyboard (US Layout).
Stars: ✭ 14 (-36.36%)
Mutual labels:  keyboard
keynavish
Control the mouse with the keyboard, on Windows.
Stars: ✭ 59 (+168.18%)
Mutual labels:  keyboard
snake
A stylised graphical tool for configuring and controlling Razer devices on Linux
Stars: ✭ 52 (+136.36%)
Mutual labels:  keyboard
react-keys
Simple way to bind keyboard to react with redux.
Stars: ✭ 50 (+127.27%)
Mutual labels:  keyboard
react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (+72.73%)
Mutual labels:  keyboard
uchroma
An advanced driver for Razer Chroma hardware in Linux
Stars: ✭ 45 (+104.55%)
Mutual labels:  keyboard
vue-number-keyboard
vue-number-keyboard是基于VUE实现的数字键盘插件,当前支持整数、小数数字输入、乱序键盘,demo中给出了常用的验证码、金额数字示例。数字键盘的大小包括字体尺寸支持响应式。
Stars: ✭ 51 (+131.82%)
Mutual labels:  keyboard

react-native-sticky-keyboard-accessory

npm downloads version GitHub issues MIT

Motivation

This library was initially built for my following projects.

Preview

iphone7 nexus5

Installation

npm install --save react-native-sticky-keyboard-accessory

or

yarn add react-native-sticky-keyboard-accessory

Usage

import KeyboardAccessory from 'react-native-sticky-keyboard-accessory';

<KeyboardAccessory>
  <View style={{ flexDirection: 'row', height: 40 }}>
    <TextInput
      style={{ flex: 1, height: 30, borderWidth: 1 }}
      placeholder='Click me!' />
    <Icon
      style={{ marginLeft: 10 }}
      name='smile-o'
      size={30} />
    <Icon
      style={{ marginLeft: 10 }}
      name='angle-down'
      size={30}
      onPress={() => Keyboard.dismiss()} />
  </View>
</KeyboardAccessory>

How it works

  • Update bottom to the height of keyboard when keyboard show
  • Reset bottom to 0 once keyboard hide
import { isIphoneX, getBottomSpace } from 'react-native-iphone-x-helper';

componentDidMount() {
  this.keyboardShowListener = Keyboard.addListener(keyboardShowEvent, (e) => this.keyboardShow(e));
  this.keyboardHideListener = Keyboard.addListener(keyboardHideEvent, (e) => this.keyboardHide(e));
}

keyboardShow(e) {
  this.setState({
    bottom: isIphoneX() ? (e.endCoordinates.height - getBottomSpace()) : e.endCoordinates.height
  });
}

keyboardHide(e) {
  this.setState({
    bottom: 0
  });
}

iPhone X (iPhone XR, iPhone XS, iPhone XS Max)

For new iPhones, if you just wrap <KeyboardAccessory> into <SafeAreaView>, the UI doesn't look good.

<SafeAreaView style={{ flex: 1 }}>
  <KeyboardAccessory>
    ...
  </KeyboardAccessory>
</SafeAreaView>

In this way, your <KeyboardAccessory> will actually occupy bottom safe area.

You should wrap one more <View> for <KeyboardAccessory>.

<SafeAreaView style={{ flex: 1 }}>
  <View style={{ flex: 1 }}>
    <KeyboardAccessory>
      ...
    </KeyboardAccessory>
  </View>
</SafeAreaView>

iphonex

You can try it out with example project.

Props

  • backgroundColor (string) - Color of keyboard accessory's background, defaults to #f6f6f6.
  • verticalOffset (number) - Adds a vertical offset, default is 0.

License

The MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].