Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backstage-modal

Package Overview
Dependencies
Maintainers
8
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backstage-modal

backstage modal

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3K
increased by41.16%
Maintainers
8
Weekly downloads
 
Created
Source

backstage-modal

Build Status

Backstage Modal React component

Installing

npm install backstage-modal --save

Components

<Modal />

Main component that includes the overlay, the modal window and its contents.

Use children to render the inner content of the modal window.

Props
  • isOpen: flag indicating wether the modal is opened or not (default false);
  • title: title of the modal window;
  • width: CSS width of the modal window (default 500px);
  • onCloseRequest: callback called when the user attempts to close the modal:
    • by clicking on the close button;
    • by clicking on the overlay;
    • by pressing the ESC key.

<ModalBody />

Optional child component to wrap content and get some nice default styles.

<ModalFooter />

Optional child component to wrap content and get some nice default styles along with a separator.

Example

import React, {Component} from 'react';
import ReactDOM from "react-dom";
import Modal, {ModalBody, ModalFooter} from 'backstage-modal';

class Example extends Component {
  constructor(){
    this.state = {
      isOpen: true
    };
  }

  onCloseRequest(){
    this.setState({isOpen: false});
  }

  render(){
    return (
      <Modal isOpen={this.state.isOpen} title="Backstage Modal" onCloseRequest={() => this.onCloseRequest}>
        <ModalBody>
          <p>Body</p>
        </ModalBody>
        <ModalFooter>
          <button type="button">OK</button>
        </ModalFooter>
      </Modal>
    );
  }
}

ReactDOM.render(<Example />, document.getElementById('container'));

FAQs

Package last updated on 01 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc