svelte-transitions

1.2.0 • Public • Published

svelte-transitions

Officially supported transitions plugin for Svelte. Includes the following:

Usage

Install with npm or yarn:

npm install --save svelte-transitions

Then add the plugins you need to your Svelte component's exported definition:

<label>
  <input type='checkbox' bind:checked='visible'> visible
</label>
 
{{#if visible}}
  <!-- use `in`, `out`, or `transition` (bidirectional) -->
  <div transition:fade>hello!</div>
{{/if}}
 
<script>
  import { fade } from 'svelte-transitions';
 
  export default {
    transitions: { fade }
  };
</script> 

Tree-shaking

If you're using a module bundler that supports tree-shaking, such as Rollup, 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, and will register itself as svelte.transitions. We recommend using a module bundler instead, however.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    396
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    396
  • 1.1.1
    3
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i svelte-transitions

Weekly Downloads

399

Version

1.2.0

License

MIT

Unpacked Size

10.2 kB

Total Files

7

Last publish

Collaborators

  • rich_harris