Socket
Socket
Sign inDemoInstall

@dorbus/react-animated-modal

Package Overview
Dependencies
5
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @dorbus/react-animated-modal

Animated modal dialogs for React, easy to use pre-built components for smooth and visually appealing user interactions.


Version published
Weekly downloads
5
decreased by-90%
Maintainers
2
Install size
4.77 MB
Created
Weekly downloads
 

Readme

Source
React Animated Modal Logo

React Animated Modal

GitHub GitHub release (latest by date including pre-releases GitHub top language GitHub Repo forks GitHub Repo stars GitHub package.json dependency version (prod) GitHub Repo stars Github Repo Sponsors

React component library for modals with animation.

This component library is inspired from Jesse Couch's Animated Modal codepen.

Demo

Installation

yarn

yarn add @dorbus/react-animated-modal

npm

npm install @dorbus/react-animated-modal

Usage

To use Animated Modal in your application, first import AnimatedModal, AnimatedModalObject, ModalAnimation and AnimatedModalFrame.

Ref

Create a Ref object using useRef and pass it to the AnimatedModal Component.

const ref = useRef<AnimatedModalObject>(null);

<AnimatedModal ref={ref} />

Opening modal

// Open modal
ref.current?.OpenModal()

// Open modal with animation
ref.current?.OpenModal(ModalAnimation.Reveal)

Closing modal

ref.current?.CloseModal()

Modal Animations

For now, the library supports seven different animations:

  • Unfold: ModalAnimation.Unfold
  • Reveal: ModalAnimation.Reveal
  • Uncover: ModalAnimation.Uncover
  • Flash: ModalAnimation.Flash
  • Slide: ModalAnimation.Slide
  • BlowUp: ModalAnimation.BlowUp
  • Sketch: ModalAnimation.Sketch

Using Animations

Use animation prop to enable different animations, by default the animation is of type Unfold.

<AnimatedModal
    ref={ref}
    animation={ModalAnimation.Unfold}/>

API

ComponentPropTypeDescriptionDefault
AnimatedModalstartOpenbooleanState open state of the modal in startfalse
animationModalAnimationDifferent modal animationsModalAnimation.Unfold
closeOnBackgroundClickbooleanWhether the modal should close on background clicktrue
backgroundStyleCSSPass custom background styles-
modalStyleCSSPass custom modal styles-

Project Created & Maintained By

Divyanshu Shekhar

GitHub followers

Aniket Pathak

GitHub followers

Stargazers

Stargazers repo roster for @dorbus/react-animated-modal

Forkers

Forkers repo roster for @dorbus/react-animated-modal

Code and documentation Copyright (c) ISC © 2022 Dorbus.

Keywords

FAQs

Last updated on 20 Jan 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc