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

@288-toolkit/slideshow

v3.2.3

Published

A slideshow component.

Downloads

103

Readme

Slideshow

A slideshow component.

Slideshow.svelte

The Slideshow component provides all of the logic to create your own slideshow. Simply put, it's a controllable interval with next and previous functions to switch slides.

Note that this component renders no markup.

Props

items

The items to loop over in the slideshow.

export let items: Array<T>;

slideDuration

The duration of each individual slide, in milliseconds.

export let slideDuration = 3500;

autoplay

Whether the slideshow should run on its own. If this is set to false, only clicking on a SlideshowButton will allow moving from slide to slide.

export let autoplay = true;

loop

Whether the slideshow should go back to the first slide when doing next from the last slide; and, conversely, whether the slideshow should go to the last slide when doing previous from the first slide.

export let loop = true;

startDelay

The delay in milliseconds before the slideshow starts.

export let startDelay = 0;

Slot props

  • readonly item (T): The item currently shown by the slideshow
  • readonly index (number): The index of the item currently shown by the slideshow

Example

<Slideshow items={[1, 2, 3, 4]} let:item let:index>
	{#key item}
		<div class="bg-[red]" transition:fade>Slide {item} {index}</div>
	{/key}
</Slideshow>

SlideshowButton.svelte

The SlideshowButton component must be a child of Slideshow. It renders a button that will either move the slideshow to the previous or the next slide.

Usually, this button will be used twice: once for previous, and once more for next.

Props

direction

direction

The direction of the button.

export let direction: 'previous' | 'next';

class

Classes to apply to the button.

Example

<SlideshowButton direction="next">Next</SlideshowButton>