0.2.0 • Published 5 years ago

react-view-switch v0.2.0

Weekly downloads
42
License
MIT
Repository
github
Last release
5 years ago

react-view-switch

Minimalistic switch component for React. It renders one child view component at a time. It can be used as building block for routers, steppers, tabs etc.

Installation

npm install react-view-switch --save

Usage

For use with es6 modules

import React from 'react';
import render from 'react-dom';
import { Switch, View } from 'react-view-switch';
 
render((
    <Switch current="first-view"}>
        <View name="first-view">
          <Component/>
        </View>
        <View name="second-view">
          <Component/>
        </View>
    </Switch>
    ), 
    'your-root-element'
);

Examples

For examples just run npm script

npm run examples

and go to http://localhost:8008

License

MIT, see LICENSE.md for details.

0.2.0

5 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago