Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-magic-scroll

> 前端框架
Open source

A cartesian way of managing scrollviews and keyboards.

188 stars0 likes1 views
WebsiteGitHub

About

A cartesian way of managing scrollviews and keyboards.

About

App & Flow is a Montreal-based React Native engineering and consulting studio. We partner with the world’s top companies and are recommended by Expo. Need a hand? Let’s build together.

Why react-native-magic-scroll?

The goal of the library is to seamlessly and precisely handle your keyboard, scrollview and inputs when interacting with forms. While other solutions offer plug-and-play functionalities, we wanted to have something more precise and with more flexibility so that it can be used in any situation.

Examples

We recreated two flows from popular apps to showcase our library in action. The demo app code is available here.

Twitch's sign up Shop's check out

Installation

react-native-magic-scroll

bash
yarn add @appandflow/react-native-magic-scroll
bash
npm i @appandflow/react-native-magic-scroll

Dependencies

To use our library, you will need to install these two dependencies into your project.

1) React Native Reanimated

bash
npx expo install react-native-reanimated

Learn more about this dependency here.

2) SafeAreaContext

bash
npx expo install react-native-safe-area-context

Learn more about this dependency here.

Android

On Android, make sure to set android:windowSoftInputMode in your AndroidManifest.xml to pan

Expo

// app.json
"android": {
  ...rest,
  "softwareKeyboardLayoutMode": "pan"
}

Basic Usage

Wrap your screen within our ScrollView.

typescript
import { MagicScroll } from '@appandflow/react-native-magic-scroll';
// rest of your imports

const YourScreen = () => {
  return // Your form;
};

export default YourScreen;

You then use our TextInputs for the form itself, that you place inside the MagicScroll.ScrollView. Easily "chain" your inputs (so that the return keyboard button hops to the next desired input) by using the MagicScroll.TextInput name and chainTo props, like so:

…

You can also use the renderInput function and use any kind of input

…

Advanced

As mentioned in the introduction, the drawbacks of a plug-and-play library are its limitations when deviating from standard functionality. That's precisely why our library allows for customization, enabling you to tailor its usage to suit your specific needs and use cases.

Tips

It's a great idea to wrap our MagicScroll.TextInput within your own for re-usability!

Here's an example

typescript
import { MagicScroll } from '@appandflow/react-native-magic-scroll';

// rest of your imports

interface Props {
  label?: string;
  isPassword?: boolean;
  name?: string;
  description?: string;
  chainTo?: string;
}

const YourCustomInput = (props: Props) => {
  return (
     {props.label}}
      renderBottom={() => {props.description}}
      textInputProps={{
        secureTextEntry: props.isPassword,
        style: {
          height: 50,
          backgroundColor: '#ddd',
          borderRadius: 10,
          marginTop: 8,
        },
      }}
    />
  );
};

Props (Optional)

All of these props are optional. It is, however, recommended to use them to get the most out of the library.

MagicScroll.ScrollView

Name Description Values
additionalPadding adds extra padding between your text input and the keyboard number
scrollViewProps contains all props of the scrollview from React's Reanimated library props

MagicScroll.TextInput

Name Description Values
chainTo a string containing the name of the next text input that will be focused when pressing the "Enter Key" string
containerStyle contains all Style props of the View from React Native props
name a string to name the current text input, used in the "chainTo" props mentionned above string
renderBottom() a function that renders components to display custom text under the text input renderBottom={() => bottomText}
renderTop() a function that renders components to display custom text above the text input renderTop={() => topText}
textInputProps contains all props of the TextInput component from React Native props

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptexpokeyboardreact-nativescrollview

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架