2.0.6 • Published 18 days ago
@neodrag/svelte v2.0.6
Features
- 🤏 Tiny - Only 1.68KB min+brotli.
- 🐇 Simple - Quite simple to use, and effectively no-config required!
- 🧙♀️ Elegant - Svelte Action, to keep the usage simple, elegant and expressive.
- 🗃️ Highly customizable - Offers tons of options that you can modify to get different behavior.
- ⚛️ Reactive - Change options passed to it on the fly, it will just work 🙂
Installing
pnpm add @neodrag/svelte
# npm
npm install @neodrag/svelte
# yarn
yarn add @neodrag/svelte
Migrating from svelte-drag
svelte-drag is the predecessor of this package. To migrate, follow this short guide: svelte-drag to @neodrag/svelte migration guide
Usage
Basic usage
<script>
import { draggable } from '@neodrag/svelte';
</script>
<div use:draggable>Hello</div>
With options
<script>
import { draggable } from '@neodrag/svelte';
</script>
<div use:draggable={{ axis: 'x', grid: [10, 10] }}>Hello</div>
Defining options elsewhere with typescript
<script lang="ts">
import { draggable, type DragOptions } from '@neodrag/svelte';
let options: DragOptions = {
axis: 'y',
bounds: 'parent',
};
</script>
<div use:draggable={options}>Hello</div>
Read the docs
Credits
Inspired from the amazing react-draggable library, and implements a similar API, but 3x smaller.
License
MIT License © Puru Vijay
2.0.6
18 days ago
2.0.5
24 days ago
2.0.4
1 month ago
2.0.0-next.6
1 year ago
2.0.0-next.4
1 year ago
2.0.0-next.5
1 year ago
2.0.3
1 year ago
2.0.2
1 year ago
2.0.0-next.2
1 year ago
2.0.0-next.3
1 year ago
2.0.0-next.0
1 year ago
2.0.0-next.1
1 year ago
2.0.1
1 year ago
2.0.0
1 year ago
1.2.4
2 years ago
1.2.3
2 years ago
1.2.0
2 years ago
1.2.2
2 years ago
1.2.1
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
3.1.0
2 years ago