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

rodal

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rodal

A React modal with animations.

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5K
increased by59.49%
Maintainers
1
Weekly downloads
 
Created
Source

Rodal Build Status NPM downloads

A React modal with animations.
Example

Installation

# React 17 or 18
npm i rodal --save

# React 15 or 16, install rodal v1
npm i rodal@1 --save

Usage

import React from 'react';
import Rodal from 'rodal';

// include styles
import 'rodal/lib/rodal.css';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = { visible: false };
  }

  show() {
    this.setState({ visible: true });
  }

  hide() {
    this.setState({ visible: false });
  }

  render() {
    return (
      <div>
        <button onClick={this.show.bind(this)}>show</button>

        <Rodal visible={this.state.visible} onClose={this.hide.bind(this)}>
          <div>Content</div>
        </Rodal>
      </div>
    );
  }
}

Props

PropertyTypeDefaultDescription
widthnumber400width of dialog
heightnumber240height of dialog
measurestringpxmeasure of width and height
onClosefunc/handler called onClose of modal
onAnimationEndfunc/handler called onEnd of animation
visibleboolfalsewhether to show dialog
showMaskbooltruewhether to show mask
closeOnEscboolfalsewhether close dialog when esc pressed
closeMaskOnClickbooltruewhether close dialog when mask clicked
showCloseButtonbooltruewhether to show close button
animationstringzoomanimation type
enterAnimationstring/enter animation type (higher order than 'animation')
leaveAnimationstringleave animation type (higher order than 'animation')
durationnumber300animation duration
classNamestring/className for the container
customStylesobject/custom styles
customMaskStylesobject/custom mask styles
idstring/id for dialog

Animation Types

  • zoom
  • fade
  • flip
  • door
  • rotate
  • slideUp
  • slideDown
  • slideLeft
  • slideRight

Other

Vue version

Keywords

FAQs

Package last updated on 17 Jul 2023

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