npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-steps-modal

v1.0.1

Published

React Native steps with indicator in a modal

Downloads

5

Readme

react-native-steps-modal

npm version

An enhanced and customizable react-native steps in a modal.

Features

  • Easily customizable
  • Plain simple and flexible APIs
  • Customizable color and timing
  • Smooth enter/exit animations for the modal
  • Resize itself correctly on device rotation
  • Swipeable

Setup

This library is available on npm, install it with: npm i react-native-steps-modal or yarn add react-native-steps-modal.

Usage

  1. Import react-native-steps-modal:
import StepsModal from "react-native-steps-modal";
  1. Create a steps modal and give its content in stepsComponents props:
render () {
  const first = <Text>I am the first</Text>;
  const second = <Text>I am the second</Text>;
  const third = <Text>I am the third</Text>;

    return (
      <View style={{ flex: 1}}>
        <StepsModal
          stepsComponents={[firstComponent, secondComponent, thirdComponent]}
        />
      </View>
    )
  }
  1. Then simply show it by setting the isVisible prop to true:
render () {
  const first = <Text>I am the first</Text>;
  const second = <Text>I am the second</Text>;
  const third = <Text>I am the third</Text>;

    return (
      <View style={{ flex: 1}}>
        <StepsModal
          isVisible={true}
          stepsComponents={[firstComponent, secondComponent, thirdComponent]}
        />
      </View>
    )
  }

The isVisible and stepsComponents props are the only props you'll really need to make the steps modal work. You should control isVisible prop value by saving it in your state and setting it to true or false when needed.

A complete example

For an example take a look at the /example directory.

Available props

| Name | Type | Default | Description | | ------------------------------ | ---------------- | ------------------------------------------ | -------------------------------------------| | isVisible | bool | REQUIRED | Show the modal? | | stepsComponents | array | REQUIRED | The steps modal content components | | animationIn | string or object | 'zoomInDown' | Modal show animation | | animationInTiming | number | 600 | Timing for the modal show animation (in ms)| | animationOut | string or object | 'zoomOutUp' | Modal hide animation | | animationOutTiming | number | 600 | Timing for the modal hide animation (in ms)| | hideSkipButton | bool | false | hide the step skip button | | skipLabel | bool | 'Skip' | skip button label | | doneLabel | bool | 'Done' | done button label | | nextLabel | bool | 'Next' | next button label | | prevLabel | bool | 'Previous' | prev button label | | indicatorStyle | object | { borderRadius: 5, width: 13, height: 13 } | style for indicator | | buttonStyle | object | { fontWeight: "bold", fontSize: 14 } | style for buttons | | colortheme | string | '#48d0cb' | color for both indicator and button | | backColor | string | '#ffffff' | steps modal background color |

Available animations

Take a look at react-native-animatable to see the dozens of animations available out-of-the-box. You can also pass in custom animation definitions and have them automatically register with react-native-animatable. For more information on creating custom animations, see the react-native-animatable animation definition schema.

Acknowledgements

Pull requests, feedbacks and suggestions are welcome!