Giter Site home page Giter Site logo

just1and0 / react-native-stepper-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danilrafiqi/react-native-stepper-ui

1.0 1.0 0.0 1.5 MB

A simple and fully customizable React Native component to create stepper ui.

License: MIT License

TypeScript 68.15% JavaScript 31.85%

react-native-stepper-ui's Introduction

react-native-stepper-ui

Platform Version Download License

A simple and fully customizable React Native component to create stepper ui.

  • Work for android and IOS
  • Support typescript
  • Customizable

Table of contents

Example

Example One Example Two Example Three

Installation

If using yarn:

yarn add react-native-stepper-ui

If using npm:

npm i react-native-stepper-ui

Usage

import React, { useState } from 'react';
import { Text, View } from 'react-native';

import Stepper from 'react-native-stepper-ui';

const MyComponent = (props) => {
  return (
    <View>
      <Text>{props.title}</Text>
    </View>
  );
};

const content = [
  <MyComponent title="Component 1" />,
  <MyComponent title="Component 2" />,
  <MyComponent title="Component 3" />,
];

const App = () => {
  const [active, setActive] = useState(0);

  return (
    <View style={{ marginVertical: 80, marginHorizontal: 20 }}>
      <Stepper
        active={active}
        content={content}
        onBack={() => setActive((p) => p - 1)}
        onFinish={() => alert('Finish')}
        onNext={() => setActive((p) => p + 1)}
      />
    </View>
  );
};

export default App;

Props

Name Type Description Default
active number index stepper active undefined
content ReactElement[] Component that render to stepper undefined
onNext Function Function called when the next step button is pressed undefined
onBack Function Function called when the back step button is pressed undefined
onFinish Function Function called when the finish step button is pressed undefined
wrapperStyle? ViewStyle Wrapper component style {}
stepStyle? ViewStyle Step component style {backgroundColor: '#1976d2', width: 30, height: 30, borderRadius: 30, justifyContent: 'center', alignItems: 'center', opacity: 1}
stepTextStyle? TextStyle Step Text component style {color: 'white'}
buttonStyle? ViewStyle Button component style { padding: 10, borderRadius: 4, alignSelf: 'flex-start', marginRight: 10, backgroundColor: '#a1a1a1'}
buttonTextStyle? TextStyle Button Text component style {color: 'white'}
showButton? boolean show button true

react-native-stepper-ui's People

Contributors

danilrafiqi avatar reyn-nova avatar yuritoledo avatar

Stargazers

 avatar

Watchers

 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.