Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swipe-scroller

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swipe-scroller

Horizontal card slider for the modern web

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-23.08%
Maintainers
1
Weekly downloads
 
Created
Source

Swipe Scroller for Svelte

Horizontal card slider for the modern web. Requires minimum JavaScript. Demo

Features

  • Snapping Cards, Smooth Scroll - Powered by CSS, not JS.
  • Easy to Use - Just pass the card components to the <slot />.
  • Customizable - Override the provided buttons and <noscript>.
  • Various Controls - Supports touch, scroll, click1, and the tab key2.
  • Light or Dark - The semi-transparent clickable buttons suits both.

Requirements

Supported and tested on the latest evergreen browsers.

ChromeSafariFirefoxSafari (iOS)Samsung Internet
CSS Scroll Snap6911681110.1
CSS Scroll-behavior6115.43615.48.2

Limitations

  • JavaScript is required to enable horizontal scroll.
  • Card components should have identical width.

Installation

Reference How it works for in-depth explanation.

  1. Prepare a SvelteKit project3.
  2. Install the package via npm.
  3. Reference the src/routes directory4.

For new projects, replace the content of the src/routes folder. Download

Events

Options

// Optional Component Props

/** Width and height of the clickable control buttons. */
export let buttonWidth = '2.5rem';
/** Horizontal gap between the provided card components. */
export let cardGap = '1.25rem';

/** Hang control buttons on the outer container border. */
export let hangButtons = true;
/** Invert the scroll direction of the control buttons. */
export let invertButtons = false;

Slots

<!-- Optional Named Slots -->

<slot name="noscript" />
<slot name="button-prev" />
<slot name="button-next" />

Footnotes

  1. The buttons are shown only when hovered with @media (pointer: fine) such as a mouse cursor.

  2. For accessibility, wrap the card component with tabbable elements such as <a> or <button>.

  3. The project should support both +(layout|page).svelte files. SvelteKit 1.x is recommended.

  4. The directory contains the source code for the demo page. It can be used as a starter template.

FAQs

Package last updated on 25 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc