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

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

Draw transition plugin for Svelte
https://github.com/sveltejs/svelte-transitions-draw

Last synced: 3 months ago
JSON representation

Draw transition plugin for Svelte

Awesome Lists containing this project

README

        

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

# svelte-transitions-draw ([demo](https://svelte.technology/repl?version=2.6.2&gist=897a0ede58c59201d57cee7f119bee50))

Draw transition plugin for [Svelte](https://svelte.technology).

This transition will only work with `` elements.

![draw](https://user-images.githubusercontent.com/1162160/40150651-d3451460-5948-11e8-8a8b-1986776a414e.gif)

## 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-draw
```

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

```html

visible

{#if visible}

{/if}

import draw from 'svelte-transitions-draw';

export default {
transitions: { draw }
};

```

## Parameters

As with most transitions, you can specify `delay` and `duration` parameters (both in milliseconds) and a custom `easing` function (which should live on your `helpers`):

```html

import draw from 'svelte-transitions-draw';
import { elasticOut } from 'eases-jsnext';

export default {
helpers: { elasticOut },
transitions: { draw }
};

```

## License

[LIL](LICENSE)