1.2.15 • Published 10 months ago
@jswork/react-modal-manager v1.2.15
react-modal-manager
A cool modal manager for react.
installation
npm install -S @jswork/react-modal-manager
usage
import css
@import "~@jswork/react-modal-manager/dist/style.css"; // or use sass @import "~@jswork/react-modal-manager/dist/style.scss"; // customize your styles: $react-modal-manager-options: ()
import js
import React from 'react'; import ReactModalManager from '@jswork/react-modal-manager'; import styled from 'styled-components'; import viteRequireContext from '@jswork/vite-require-context'; import '@jswork/next'; const Container = styled.div` width: 80%; margin: 30px auto 0; `; const moduleFiles = import.meta.globEager('./modals/*.jsx'); const context = viteRequireContext(moduleFiles); export default () => { return ( <Container> <ReactModalManager context={context} inject={(e) => { nx.$modal = e; }}> <button onClick={() => { nx.$modal.present('modal1'); }}> MyModal </button> </ReactModalManager> </Container> ); };
preview
license
Code released under the MIT license.
1.2.13
10 months ago
1.2.14
10 months ago
1.2.15
10 months ago
1.2.9
1 year ago
1.2.12
12 months ago
1.2.10
12 months ago
1.2.8
1 year ago
1.2.7
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.1.1
3 years ago
1.1.6
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.2
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago