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

sladio

v1.5.1

Published

Sladio

Downloads

2

Readme

Sladio

Documentación en español

How is it used?

The first step is to install sladio as a dependency

npm install sladio

In our html you must assign the following classes

<div class="sladio">
  <div class="sladio__container">
    <div class="sladio__items">item0</div>
    <div class="sladio__items">item1</div>
    <div class="sladio__items">item2</div>
   </div>
</div>

You can also place an id in the element explicitly, if you do not do it, sladio will assign it automatically, note that this id is the one that goes in the configuration object


<div class="sladio" id="slider1">
	//...
</div>

If you don't put the sladio_ container container, sladio will create it automatically and put all the items inside it.

Once downloaded and with the assigned classes we create an instance of sladio

const slider = new Sladio();

Sladio receives its configuration object as the first and only parameter, if it does not detect one it automatically sets one default

Default configuration

navigation: {
	dragAndDrop: true,
	orientation: 'horizontal',
	infinity: false,
	buttons: {
		active: false,
	},
}

Configuration object

As sladio is a fairly customizable slider, its configuration will be somewhat extensive, I recommend you to have this configuration in an external file, and thus have the cleanest code.

export const sladioConfig = {};

import { sladioConfig } from '{path}/sladioConfig';

const slider = new Sladio(sladioConfig);

// Or...

const slider = new Sladio({
	//...
});

Example configuration

const config = {
  mode: 'development',

  navegation: {

    slider1: {
      dragAndDrop: true,
      orientation: 'horizontal', 
      infinity: true, 

      buttons: {
        active: true, 
        btnPrev: 'btn__prev',
        btnNext: 'btn__next',
        position: 'center',
      },

    },

  },
};

Parametros

| Key | Value | Type | Description | | ------------------------------- | -------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | mode | development / production | string | In this parameter we define if we are in a production or development environment, this is responsible for showing us logs in the console of missing configurations or errors. | | navegation | sliderId | object | This parameter defines the configuration for the navigation of the slider, it is a list of objects where their keys are the ids of the sliders for example: slider1 | | navegation.sliderId.dragAndDrop | true / false | boolean | This parameter tells us if we want the drag & drop in our slider (Desktop mode) | | navegation.sliderId.orientation | vertical / horizontal | string | This parameter tells us if we want the selected slider to scroll horizontally or vertically | | navegation.sliderId.infinity | true / false | boolean | This parameter tells us that the selected slider has an infinite scroll | | navegation.sliderId.buttons | active: boolean, btnPrev: string, btnNext: string, position: string, | object | This parameter configures the slider buttons - active: receives a boolean, this show or hide buttons - btnPrev, btnNext: Name of the class that will be applied to the buttons - position: Position where the buttons will be shown (top, center, bottom) |