https://github.com/sveltejs/svelte-transitions
Officially supported transition plugins for Svelte
https://github.com/sveltejs/svelte-transitions
Last synced: about 2 months ago
JSON representation
Officially supported transition plugins for Svelte
- Host: GitHub
- URL: https://github.com/sveltejs/svelte-transitions
- Owner: sveltejs
- License: mit
- Archived: true
- Created: 2017-05-07T03:40:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-09T19:45:06.000Z (over 6 years ago)
- Last Synced: 2024-04-13T22:42:49.615Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 34
- Watchers: 7
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## DEPRECATED — As of Svelte v3, transitions are built into the main package
# svelte-transitions
Officially supported transitions plugin for [Svelte](https://svelte.technology). Includes the following:
* [fade](https://github.com/sveltejs/svelte-transitions-fade)
* [fly](https://github.com/sveltejs/svelte-transitions-fly)
* [slide](https://github.com/sveltejs/svelte-transitions-slide)
* [draw](https://github.com/sveltejs/svelte-transitions-draw)
## Usage
Install with npm or yarn:
```bash
npm install --save svelte-transitions
```
Then add the plugins you need to your Svelte component's exported definition:
```html
visible
{{#if visible}}
hello!
{{/if}}
import { fade } from 'svelte-transitions';
export default {
transitions: { fade }
};
```
## Tree-shaking
If you're using a module bundler that supports tree-shaking, such as [Rollup](https://rollupjs.org), only the transitions your components use will be included in your app.
## Universal module definition
If you *really* need it, a UMD build is available at [svelte-transitions/dist/svelte-transitions.js](https://unpkg.com/svelte-transitions/dist/svelte-transitions.js), and will register itself as `svelte.transitions`. We recommend using a module bundler instead, however.
## License
[MIT](LICENSE)