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-flex-slider

v1.0.5

Published

A flexible and responsive slider/carousel component for Svelte applications

Downloads

232

Readme

Svelte Flex Slider

A flexible and responsive slider component for Svelte applications.

Svelte Flex Slider Demo

Features

  • Responsive design with customizable breakpoints
  • Autoplay functionality with adjustable interval
  • Loop option for continuous sliding
  • Touch-friendly navigation
  • Customizable number of visible cards
  • Optional navigation buttons and indicators
  • Easy to integrate and style

Installation

Install Svelte Flex Slider with npm:

npm install svelte-flex-slider

Usage

Import and use the SvelteFlexSlider component in your Svelte file:

<script>
import SvelteFlexSlider from 'svelte-flex-slider';

const cards = [
  '<div>Slide 1</div>',
  '<div>Slide 2</div>',
  '<div>Slide 3</div>'
];
</script>

<SvelteFlexSlider
  {cards}
  autoplay={true}
  interval={3000}
  loop={true}
  visibleCards={{ default: 1, 768: 2, 1024: 3 }}
  showNavButtons={true}
  showIndicators={true}
/>

Documentation

For full documentation and interactive examples, visit our documentation site.

API

| Prop | Type | Default | Description | |------|------|---------|-------------| | cards | array | [] | Array of card contents to be displayed in the slider. | | autoplay | boolean | true | Whether the slider should autoplay. | | interval | number | 3000 | Interval between slides in milliseconds when autoplay is enabled. | | loop | boolean | true | Whether the slider should loop back to the beginning after reaching the end. | | visibleCards | object | { default: 1 } | Number of visible cards at different breakpoints. | | showNavButtons | boolean | true | Whether to show navigation buttons. | | showIndicators | boolean | true | Whether to show slide indicators. |

Examples

Image Slider with Custom Navigation

<SvelteFlexSlider
  cards={[
    '<div><img src="img1.jpg" alt="Slide 1"></div>',
    '<div><img src="img2.jpg" alt="Slide 2"></div>',
    '<div><img src="img3.jpg" alt="Slide 3"></div>'
  ]}
  autoplay={true}
  interval={3000}
  loop={true}
  visibleCards={{ default: 1 }}
  showNavButtons={true}
  showIndicators={false}
/>

Product Showcase with Indicators

<SvelteFlexSlider
  cards={[
    '<div class="product"><img src="product1.jpg" alt="Product 1"><h3>Product 1</h3><p>$19.99</p></div>',
    '<div class="product"><img src="product2.jpg" alt="Product 2"><h3>Product 2</h3><p>$24.99</p></div>',
    '<div class="product"><img src="product3.jpg" alt="Product 3"><h3>Product 3</h3><p>$29.99</p></div>'
  ]}
  autoplay={false}
  interval={3000}
  loop={true}
  visibleCards={{ default: 1, 520: 2, 800: 3 }}
  showNavButtons={false}
  showIndicators={true}
/>

For more examples and interactive demos, visit our documentation site.

Styling

Svelte Flex Slider comes with minimal default styling. You can easily customize the appearance by adding your own CSS classes or inline styles to the card contents.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

Acknowledgements

  • Thanks to the Svelte community for their amazing tools and support.
  • Icons provided by Lucide.

Made with ❤️ by Naresh Choudhary (nakxa)