Coder Social home page Coder Social logo

trendingtechnology / react-losen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from otovo/react-losen

0.0 1.0 0.0 2.65 MB

A super customisable Wizard for React and React Native. Docs ๐Ÿ‘‰

Home Page: https://docs-geycgwirqi.now.sh/

License: MIT License

HCL 3.39% JavaScript 92.67% HTML 3.94%

react-losen's Introduction

name route
Home
/

react-losen

react-losen ยท GitHub license

A brutallty simple wizard for React and React Native. Note: This module is under active development and not ready for release yet.

Install

yarn add react-losen

Example

import { Wizard, Step, Controls } from 'react-losen';

<Wizard
  render={() => (
    <Fragment>
      <Step name="start">Step one</Step>
      <Step name="second-step">This is the second step</Step>
      <Step name="final-step">Click next to finish</Step>

      <Controls
        render={(onNext, onPrevious, isFirstStep) => (
          <Fragment>
            <Button onClick={onPrevious} disabled={isFirstStep}>
              Previous
            </Button>

            <Button onClick={onNext}>Next</Button>
          </Fragment>
        )}
      />
    </Fragment>
  )}
/>;

Developing

Built With

react-losen is built with React and it's Context API under the hood. We use render props to expose functionality to child components.

Developing

Use docz:dev to spin up a dev server which let's you view and play with the source components. To get started, create a .md in the ./pages directory. It uses MDX which let's you import and write JSX within markdown documents. For more info out the Docz website and read up on the MDX spec.

Building

yarn build

This command uses @pika/pack to build for browsers. Plugins are specified under @pika/pack in package.json.

Publishing

Publish new versions with yarn pack:publish. Pika guides you through the Through a wizard, this helps you bump the version number and publish to npm.

Deloying docs

The documentation is built by running yarn docz:build. This generates a static site in ./docs/. Currently the site is deployed and hosted with Zeit's Now.

Versioning

react-losen use SemVer for versioning. For the versions available, see the link to tags on this repository.

Tests

TODO: Add jest.

Style guide

At react-losen, we use the following tools:

API reference

  • Wizard, the main orchestrator. It has 2 required props
    • render: This takes a set of Step as children. Minumum 2. Start and end
    • onComplete: What to do when the Wizard is complete.
    • onStepChange is called each time the step changes. This function is not called on initial load.
  • Step, a wrapper for what you want to show as a step. It registers the step on mount to the Wizard context
  • Controls, the controller for which step to show next. Has 2 directions: next and previous. It also knows if you are on the last or first step.

Licensing

MIT

react-losen's People

Contributors

kmkr avatar magnudae avatar mortnod avatar rix1 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.