GithubHelp home page GithubHelp logo

suretarget / rn-keyboard-sticky-view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jinsoo601/rn-keyboard-sticky-view

0.0 1.0 0.0 19 KB

[React Native] Add Whatever You Want (TextInput, Buttons) Inside This Keyboard Sticky View

License: MIT License

JavaScript 100.00%

rn-keyboard-sticky-view's Introduction

rn-keyboard-sticky-view

Add your own component inside this lightweight KeyboardStickyView, whether it be TextInput, Buttons, or who knows what! Supports both Android and iOS.

This component accomplishes the desired outcome using KeyboardAvoidingView provided by react-native, without the complicated animation code.

Preview

iOS Demo Android Demo

Installation

npm i rn-keyboard-sticky-view

or

yarn add rn-keyboard-sticky-view

Example

import React from 'react';
import { StyleSheet, TextInput } from 'react-native';
import KeyboardStickyView from 'rn-keyboard-sticky-view';

const KeyboardInput = (props) => {
  const [value, setValue] = React.useState('');

  return (
    <KeyboardStickyView style={styles.keyboardView}>
      <TextInput
        value={value}
        onChangeText={setValue}
        onSubmitEditing={() => alert(value)}
        placeholder="Write something..."
        style={styles.input}
      />
    </KeyboardStickyView>
  );
}

const styles = StyleSheet.create({
  keyboardView: { ... },
  input: { ... }
});

export default KeyboardInput;

Props

Props Type Description Default
style object Style of the KeyboardStickyView (background, border, etc.) {}
children node Content of the KeyboardStickyView null

Give me a Star

If you think this project is helpful just give me a ⭐️ :D

License

This project is licensed under the MIT License.

Author

Brought to you by Jinsoo Lim

rn-keyboard-sticky-view's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.