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

svelte-tiny-slider

v2.1.0

Published

A lightweight unopinionated slider or carousel that gives you the tools you need to create the slider that fits your needs.

Downloads

1,148

Readme

Svelte Tiny Slider

Svelte Tiny Slider is an easy to use highly customizable and unopinionated carousel or slider. There is little to no styling and how you structure your content is up to you. Images, videos, or any other element will work. Works with touch and keyboard controls. Made with accessiblity in mind.

npm version npm downloads bundle size

The package is less than 250 bytes gzipped (Bundlephopbia) and has no dependencies.

Demo and Docs: https://mitcheljager.github.io/svelte-tiny-slider/

Installation

Install using Yarn or NPM.

yarn add svelte-tiny-slider@^1.0.0 --dev // Svelte 4
yarn add svelte-tiny-slider@^2.0.0 --dev // Svelte 5
npm install svelte-tiny-slider@^1.0.0 --save-dev // Svelte 4
npm install svelte-tiny-slider@^2.0.0 --save-dev // Svelte 5

Include the component in your app.

import { TinySlider } from "svelte-tiny-slider"
<TinySlider>
  ...
</TinySlider>

Usage

For detailed documentation on every property check out: https://mitcheljager.github.io/svelte-tiny-slider/

Configuration

Properties

| Property | Default | Description | |---|---|---| | gap | 0 | Gap between each item. Can be any CSS value. | | fill | true | Boolean to set whether the slider is always filled fully when at the end. | | transitionDuration | 300 | Transition between items in milliseconds. | | threshold | 30 | Value in pixels for when you navigate when using drag controls. | | currentIndex | 0 | Index of the current slide (Read only). | | shown | [] | Array of all shown indexes (Read only). | | sliderWidth | 0 | Box width in pixels of the slider as it is on the page (Read only). | | maxWidth | 0 | Full width in pixels of all items together (Read only). | | currentScrollPosition | 0 | Current position in the slider in pixels (Read only). | | reachedEnd | false | Boolean that is set to true when you have reached the end of the slider (Read only). | | distanceToEnd | 0 | Distance in pixels until you reach the end of the slider (Read only). |

Function

| Name | Properties | Description | |---|---|---| | setIndex | index | Used to set the slider to the specified index. |

Events

| Name | Description | |---|---| | end | Fired when the end of the slider has been reached. | | change | Fired when the slider changes it's index. The detail prop of the event is the current index. |