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-stepper-view

v0.2.6

Published

A simple and fully customizable React Native component that implements a progress stepper view.

Downloads

128

Readme

React Native Stepper View

A simple and fully customizable React Native component that implements a progress stepper view.

Installation

yarn add react-native-stepper-view

Screenshots

Usage

import * as React from 'react';
import { View, Text } from 'react-native';
import Stepper from 'react-native-stepper-view';

const App: React.FC = () => {
  const handleSubmit = React.useCallback(() => {
    console.log('submitted');
  }, [])

  const handlePrevStep = React.useCallback((prevStep: number) => {
    console.log('navigate to:', prevStep);
  }, []);

  const handleNextStep = React.useCallback((nextStep: number) => {
    console.log('navigate to:', nextStep);
  }, []);

  return (
    <Stepper
      onSubmit={handleSubmit}
      onPrevStep={handlePrevStep}
      onNextStep={handleNextStep}
      numberOfSteps={3}
    >
      <Stepper.Step label="Step 1">
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
          <Text>Step 1 view</Text>
        </View>
      </Stepper.Step>

      <Stepper.Step label="Step 2">
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
          <Text>Step 2 view</Text>
        </View>
      </Stepper.Step>

      <Stepper.Step label="Step 3">
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
          <Text>Step 3 view</Text>
        </View>
      </Stepper.Step>
    </Stepper>
  );
};

See example for a more detailed usage.

API

<Stepper />

numberOfSteps={number}: Determines the number of steps.

activeStep={number}: Manually specify the active step.

showButtons={boolean}: When set to false, the buttons (previous, next and submit) are not rendered.

allCompleted={boolean}: Marks all steps as completed.

onPrevStep={(prevStep: number) => void}: Triggered when navigate to the previous step.

onNextStep={(nextStep: number) => void}: Triggered when navigate to the next step.

onSubmit={() => void}: It is triggered when the submit button in the last step is pressed.

stepProps={object}: Used to assign props to each step.

ButtonComponent={React.ComponentType}: Component of the buttons (previous, next and submit).

stepContainerStyle={StyleProp<ViewStyle>}: Used to style the step container view.

buttonsContainerStyle={StyleProp<ViewStyle>}: Used to style the buttons container view.

stepIconsContainerStyle={StyleProp<ViewStyle>}: Used to style the step icons container view.

prevButtonDisabled={boolean}: When set true, the previous button is disabled.

nextButtonDisabled={boolean}: When set true, the next button is disabled.

submitButtonDisabled={boolean}: When set true, the submit button is disabled.

<Stepper.Step />

label={string}: Title of the step.

activeIcon={React.ReactElement<TextProps>}: Icon of active step.

disabledIcon={React.ReactElement<TextProps>}: Icon of disabled step.

completedIcon={React.ReactElement<TextProps>}: Icon of completed step.

progressBarSize={number}: Height of the progress bar.

progressBarBgColor={ColorValue}: Background color of the default progress bar.

completedProgressBarBgColor={ColorValue}: Background color of the completed progress bar.

activeStepIconBgColor={ColorValue}: Background color of the active step icon.

disabledStepIconBgColor={ColorValue}: Background color of the disabled step icon.

completedStepIconBgColor={ColorValue}: Background color of the completed step icon.

activeStepIconBorderColor={ColorValue}: Border color of the active step icon.

labelColor={ColorValue}: Color of the default label.

labelFontSize={number}: Font size for the step icon label.

labelFontFamily={string}: Font family for the step icon label.

labelFontWeight={TextStyle['fontWeight']}: Font weight for the step icon label.

activeLabelColor={ColorValue}: Color of the active label.

activeLabelFontSize={number}: Font size for the active step icon label.

completedLabelColor={ColorValue}: Color of the completed label.

stepNumFontSize={number}: Font size for the step number.

stepNumFontFamily={string}: Font family for the step number.

stepNumFontWeight={TextStyle['fontWeight']}: Font weight for the step number.

activeStepNumColor={ColorValue}: Color of the active step number.

disabledStepNumColor={ColorValue}: Color of the disabled step number.

completedCheckColor={ColorValue}: Color of the completed step checkmark.

<Stepper ref={stepperRef} />

stepperRef.jumpToStep(value): Used to navigate to the step.

stepperRef.prevStep(): Used to navigate to the previous step.

stepperRef.nextStep(): Used to navigate to the next step.

stepperRef.showButtons(): Used to show the buttons.

stepperRef.hideButtons(): Used to hide the buttons.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library