npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-slider-modal

v1.3.1

Published

react slider modal slide in and slide out a div at a certain position.Option to change animation on slider like- fade, zoom, bounce, slide; default it is slide

Downloads

51

Readme

##React-Slider-Modal

Features

  • slide in and slide out a div at a certain position
  • set slide direction from the top, left, right, bottom, bottom-right, top-right, bottom-left,
  • Add the position of the slider by apply CSS
  • Option to change animation on slider like- fade, zoom, bounce, slide; default it is slide
  • add your class

Installation via NPM

npm install react-slider-modal

npm install animation.css

**Dependency ** Please add animation.css as a dependency on your project

Usage

import slider from 'react-slider-modal';

<Slider render={
  // function or component
} id="" direction="right" />

/* or */

<Slider id="" direction="right" >
  // html , component or function
</Slider>

**Props **

  • sliderStyle- set the style of slider by using css,
  • id - set the id of this slider !important
  • size - set the size of modal small,large,medium, semi-medium
  • closeModal - callback function it call when click outside of modal
  • direction - direction from top, left, right, bottom, bottom-right, top-right, bottom-left
  • toggle - pass the value true/false for show/hide the slider
  • speed - slow, fast, medium, faster
  • closeIcon - function that take state of slider true/false add close icon on modal
  • render - pass the html data as a function , component
  • animation - change animation on slider like- fade, zoom, bounce, slide; default it is slide
  • className - apply class
  • shadow - showing shadow in background, default true
  • outSideClose - click on outside of modal then slider is close, default true
  • outSideMouseEvent - outside enable/disable click event when model is open, default false

##Example 1:

import React, { useState } from 'react';
import Slider from 'react-slider-modal';
import 'animate.css/animate.min.css'


function App() {
  const [slideShow, setSlideShow] = useState(false)

  const htmlData = () => {
    return (
      <>
         <div className="slider-container">
                <div className="sliderHeader">Create Lead</div>
                <div className="sliderBody">
                    <div className="sliderLeftBox">
                      Hello World
                    </div>
                    <div className="sliderRightBox">
                      Right Box
                    </div>
                </div>
                <div className="sliderFooter">
                <button className="btn btn-primary"
					      onClick={() => setSlideShow(false)}>Cancel</button>
                </div>
            </div>
        </>

    )
  }
  return (
    <>
      <button onClick={() => { setSlideShow(!slideShow) }}>Slide Me</button>
      <Slider
      id="demoID2"
      animation="zoom"
      speed="fast"
      closeIcon={(e)=> {setSlideShow(e)}}
      toggle={slideShow}
      sliderStyle={{
           "width": "500px",
           "height": "100%",
           "top": "0px"
        }}
      closeModal={() => { setSlideShow(false)}
      direction="right"
      render={htmlData()} />
      className=""
    </>
  );
}

export default App

##Example 2:

import React, { useState } from 'react';
import Slider from 'react-slider-modal';
import 'animate.css/animate.min.css'

   const sliderStyle ={{
           "width": "500px",
           "height": "400px",
           "right": "100px",
           "top": "50px"
        }
function App() {
  const [slideShow, setSlideShow] = useState(false)
  return (
    <>
      <button onClick={() => { setSlideShow(!slideShow) }}>Slide Me</button>

      <Slider id="demoID3" className="" direction ="top"
      size="medium"
      animation="slide"
      closeModal={(e)=> {setSlideShow(e)}}
      toggle={slideShow}
      closeIcon={() => { setSlideShow(false)}}
	    direction="right" >
            <div className="slider-container">
                <div className="sliderHeader">Create Lead</div>
                <div className="sliderBody">
                    <div className="sliderLeftBox">
                      Hello World
                    </div>
                    <div className="sliderRightBox">
                      Right Box
                    </div>
                </div>
                <div className="sliderFooter">
                    <button className="btn btn-primary"
				          	onClick={() => setSlideShow(false)}>Cancel</button>
                </div>
            </div>
      </Slider>
    </>
  );
}

export default App