# svelte-tiny-slider

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

Latest version **2.8.1** (published 2026-07-08) · 0 weekly downloads

## Install

```sh
npm install svelte-tiny-slider
pnpm add svelte-tiny-slider
yarn add svelte-tiny-slider
bun add svelte-tiny-slider
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.8.1 |
| Published | 2026-07-08 |
| First published | 2022-08-26 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 63 |
| Maintainers | mitcheljager |
| Keywords | slider, carousel, gallery |

## Links

- npm: https://www.npmjs.com/package/svelte-tiny-slider
- Repository: https://github.com/Mitcheljager/svelte-tiny-slider
- Homepage: https://mitcheljager.github.io/svelte-tiny-slider/
- Issues: https://github.com/Mitcheljager/svelte-tiny-slider/issues
- npm.io page: https://npm.io/package/svelte-tiny-slider

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 2.8.1 (latest) — 2026-07-08
- 2.8.0 — 2026-07-06
- 2.7.2 — 2026-06-10
- 2.7.1 — 2026-05-14
- 2.7.0 — 2026-05-06
- 2.6.1 — 2026-05-06
- 2.6.0 — 2026-05-06
- 2.5.0 — 2026-05-06
- 2.4.1 — 2025-12-26
- 2.4.0 — 2025-12-26
- 2.3.1 — 2025-12-26
- 2.3.0 — 2025-10-07
- 2.2.1 — 2025-10-06
- 2.2.0 — 2025-01-27
- 2.1.0 — 2024-11-24
- … 15 more at https://npm.io/package/svelte-tiny-slider/versions

## 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](https://badgen.net/npm/v/svelte-tiny-slider)](https://www.npmjs.com/package/svelte-tiny-slider)
[![npm downloads](https://badgen.net/npm/dt/svelte-tiny-slider)](https://www.npmjs.com/package/svelte-tiny-slider)
[![bundle size](https://img.shields.io/bundlephobia/minzip/svelte-tiny-slider)](https://bundlephobia.com/package/svelte-tiny-slider)

The package is less than 1.5kb gzipped ([Bundlephopbia](https://bundlephobia.com/package/svelte-tiny-slider)) and has no dependencies.

**Demo and Docs**: https://mitcheljager.github.io/svelte-tiny-slider/

### Installation

Install using Yarn or NPM.
```js
yarn add svelte-tiny-slider@^1.0.0 --dev // Svelte 4
yarn add svelte-tiny-slider@^2.0.0 --dev // Svelte 5
```
```js
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.
```js
import { TinySlider } from "svelte-tiny-slider"
```
```svelte
<TinySlider>
  ...
</TinySlider>
```

## Usage

For detailed documentation on every property check out: [https://mitcheljager.github.io/svelte-tiny-slider/](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. |
| vertical | true | Boolean to set use vertical scrolling rather than left to right. |
| transitionDuration | 300 | Transition between items in milliseconds. |
| threshold | 30 | Value in pixels for when you navigate when using drag controls. |
| moveThreshold | 0 | Value in pixels for when the slider starts to move 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). |
| sliderHeight | 0 | Box height 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). |
| maxHeight | 0 | Full height 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. |
| reposition | index | Used to manually reposition the slider without playing transitions. |

#### Events

| Name | Description |
|---|---|
| onend | Fired when the end of the slider has been reached. |
| onchange | Fired when the slider changes it's index. The returned parameter of the event is the current index. |
| onresize | Fired when the content of the slider changes in size. |

---
_Source: https://npm.io/package/svelte-tiny-slider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
