An open API service indexing awesome lists of open source software.

https://github.com/sveltejs/svelte-transitions-slide

Slide transition plugin for Svelte
https://github.com/sveltejs/svelte-transitions-slide

Last synced: 3 months ago
JSON representation

Slide transition plugin for Svelte

Awesome Lists containing this project

README

        

## DEPRECATED — As of Svelte v3, transitions are built into the main package

# svelte-transitions-slide

Slide transition plugin for [Svelte](https://svelte.technology). [Demo](https://svelte.technology/repl?version=2.5.0&gist=b447904fdd05737538c24268cca144cc)

![slide-hello](https://cloud.githubusercontent.com/assets/1162160/25782611/50b10200-331c-11e7-9cd9-9ce8cbaf3f33.gif)

Note that this transition will behave oddly with `display: inline` elements.

## Usage

Recommended usage is via [svelte-transitions](https://github.com/sveltejs/svelte-transitions), but you can use this module directly if you prefer. Note that it assumes an ES module or CommonJS environment.

Install with npm or yarn:

```bash
npm install --save svelte-transitions-slide
```

Then add the plugin to your Svelte component's exported definition:

```html

visible

{#if visible}

hello!

{/if}

import slide from 'svelte-transitions-slide';

export default {
transitions: { slide }
};

```

## Parameters

You can specify `delay` and `duration` parameters, which default to `0` and `400` respectively, and a custom `easing` function (which should live on your `helpers`):

```html


slides in slowly

import slide from 'svelte-transitions-slide';
import { quintInOut } from 'eases-jsnext';

export default {
helpers: { quintInOut },
transitions: { slide }
};

```

## License

[MIT](LICENSE)