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

page-slider-react

v1.0.4

Published

Page slider module for react.

Downloads

15

Readme

Page Slider React

Full Screen React Page slider. Navigational bars, mouse wheels, and mobile touch are available. Supports asynchronous rendering of various types of components.

react-page-slider-sample

Usage

installing

$ npm install page-slider-react

Conditions

  • page-slider-react must always be in a component that is 100% width and height.
  • Css embedded in page-slider-react contains code for adjusting the height of the elements to 100%.
body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  overflow: hidden;
}
#root,
.App {
  height: 100%;
}

Example

TestComp.js
import React from 'react';

function TestComp01() {
  return <div className="test-comp">Test Component</div>;
}

export default TestComp01;
App.js
import React from 'react';
import { PageSlider } from 'page-slider-react';

import TestComp from './components/TestComp';

function App() {
  const compList = [
    TestComp, // Functional Component
    <TestComp />, // React Node
    () => TestComp, // Function that returns Functional Component
    async () => { // Asynchronous function that returns Functional Component
      await new Promise(resolve => setTimeout(resolve, 2000));
      return TestComp;
    },
    () => import('./components/TestComp'), // Dynamic Import
  ];

  return (
    <div className="App">
      <PageSlider compList={compList} />
    </div>
  );
}

Options

compList

List of compositions to show on the slider. It is an essential Property.

horizontal

If this value is true then the horizontal slider is created, and if false then the vertical slider is created. Default value is false.

actionFlagTime

Specifies the time between slide actions. The smaller the value, the shorter the time between the action and the action. If this value is too short, two actions can be taken at a time of scrolling. Default value is 500.

sensitivity

Adjust sensitivity for mouse scrolling and mobile touch. The smaller the number, the more sensitive. Default value is 80.

navigation

Specify detailed settings for the navigation bar.

  • type: Specify locate of navigation bar. Enter either top, right, bottom, left, or none. If you type none, the navigation bar is not visible. Default value is none.
  • hide: Make the navigation bar invisible when not in use. Default value is false.
  • timer: Set the time navigation bar is displayed when the hide is true. The unit is milliseconds. Default value is 2000.
  • size: Specify the size of navigation bar. Style unit is internally used em, navigation bar is resized to match the changes of this value. Default value is 16.
  • unit: It is a unit of size. Enter either px, em, rem, vh, vw or '%'. Default value is px.
<PageSlider
  compList={compList}
  horizontal={false}
  actionFlagTime={500}
  sensitivity={100}
  navigation={{
    type: 'right',
    hide: true,
    timer: 2000,
    size: 16,
    unit: 'px',
  }}
/>

Demo Deploy

$ npm install
$ npm run build
$ npm run build:types
$ cd example
$ npm install
$ npm start