Coder Social home page Coder Social logo

akav's Introduction

AKAV (ActualKeyboardAvoidingView)

Because https://reactnative.dev/docs/keyboardavoidingview isn't enough (we still use it though)

The Problem:

Keyboard placement in React Native has been an inconvience for me and for many other developers. And simply follolowing the docs isn't quite ideal.

The Solution:

A universal view where the skelenton of the page is defined, and action buttons are well positioned, regardless where the keyboard is.

Preview:

Keyboard Shown Keyboard Hidden
import AKAV from '@ajxb/akav'

const RenderSubmitButton = () => {
	return <Button type={'primary'} title={'Login'} onPress={handleLogin}/> } offset={120} pl={10} pr={10} testID={'loginSubmitButton'}/>
}

<AKAV submitButton={<RenderSubmitButton/>}
	<MyLogo/>
	<MyEmailInputField/>
	<MyPasswordInputField/>
</AKAV/>
Prop Description Type Default
submitButton Most likely View container that contains the page's - Call to - action buttons ReactNode Required
children The rest of the page's components, like forms and images [ReactNode] Required
background The background color of the SafeAreaView that contains the children String #FFFFFF
pl Padding left of the SafeAreaView that contains the children Number 20
pr Padding right of the SafeAreaView that contains the children Number 20
needsSTB Does the ScrollView need to scroll to the bottom of the page when keyboard opens? (Useful in some edge cases) Boolean false
offset The KeyboardAvoidingView offset, (see Documentation) Number 100

akav's People

Contributors

ajw-m avatar galamage avatar mrgsub avatar

Stargazers

 avatar  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.