1.2.8 • Published 4 months ago

@jswork/react-modal-manager v1.2.8

Weekly downloads
337
License
MIT
Repository
-
Last release
4 months ago

react-modal-manager

A cool modal manager for react.

version license size download

installation

npm install -S @jswork/react-modal-manager

usage

  1. 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: ()
  2. 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.8

4 months ago

1.2.7

4 months ago

1.2.6

4 months ago

1.2.5

4 months ago

1.2.4

4 months ago

1.2.3

4 months ago

1.2.2

4 months ago

1.1.1

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago