1.1.5 • Published 1 month ago

svelte-tiny-slider v1.1.5

Weekly downloads
-
License
-
Repository
github
Last release
1 month ago

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 --dev
npm install svelte-tiny-slider --save-dev

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

PropertyDefaultDescription
gap0Gap between each item. Can be any CSS value.
filltrueBoolean to set whether the slider is always filled fully when at the end.
transitionDuration300Transition between items in milliseconds.
threshold30Value in pixels for when you navigate when using drag controls.
currentIndex0Index of the current slide (Read only).
shown[]Array of all shown indexes (Read only).
sliderWidth0Box width in pixels of the slider as it is on the page (Read only).
maxWidth0Full width in pixels of all items together (Read only).
currentScrollPosition0Current position in the slider in pixels (Read only).
reachedEndfalseBoolean that is set to true when you have reached the end of the slider (Read only).
distanceToEnd0Distance in pixels until you reach the end of the slider (Read only).

Function

NamePropertiesDescription
setIndexindexUsed to set the slider to the specified index.

Events

NameDescription
endFired when the end of the slider has been reached.
changeFired when the slider changes it's index. The detail prop of the event is the current index.
1.1.5

1 month ago

1.1.4

2 months ago

1.1.3

2 months ago

1.1.2

2 months ago

1.1.1

8 months ago

1.1.0

9 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.3

11 months ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago