0.1.1 • Published 5 years ago

redux-modal-tabs v0.1.1

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

Redux Modal Tabs

A sidebar with multiple tabs for projects with React and Redux.

Dependencies

There are a number of peer dependencies that your project needs to include:

  • react
  • react-redux
  • redux

Installation

npm install redux-modal-tabs

Usage

1. Configure the reducer

import { reduxModalTabsReducer } from 'redux-modal-tabs';

export const rootReducer = (history) => combineReducers({
    ...
	reduxModalTabs: reduxModalTabsReducer
	...
});

2. Import the css (optional)

// in index.tsx or app.tsx, wherever makes most sense for you
import 'redux-modal-tabs/css/style.css';

3. Opening tabs

import { addModalTab } from 'redux-modal-tabs';

class MyComponent extends React.Component {
    ...

    onClick() {
        const { dispatch } = this.props;

        dispatch(addModalTab(
            'My title',
            <MyContentComponent />
        ));
    }

    ...
}
0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago