
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
svelte-swipeout
Advanced tools
iOS-style swipeable list component for Svelte 5 with delete animations and mobile-optimized touch handling
A powerful and flexible swipeable list component for Svelte 5 applications with iOS-style swipe actions, delete animations, and mobile-optimized touch handling.
npm install svelte-swipeout
or
pnpm add svelte-swipeout
or
yarn add svelte-swipeout
Here is a simple example of how to use the svelte-swipeout components:
<script>
import {
Swipeout,
SwipeoutItem,
SwipeoutContent,
SwipeoutActionsLeft,
SwipeoutActionsRight,
SwipeoutAction,
} from 'svelte-swipeout';
</script>
<Swipeout>
<SwipeoutItem>
<SwipeoutContent>
<div class="item">Swipe me</div>
</SwipeoutContent>
<SwipeoutActionsRight>
<SwipeoutAction onclick={() => console.log('Delete clicked')}>
Delete
</SwipeoutAction>
</SwipeoutActionsRight>
</SwipeoutItem>
</Swipeout>
This example shows a simple swipe with left and right actions.
<Swipeout>
<SwipeoutItem>
<SwipeoutContent>
<div class="item">Swipe me</div>
</SwipeoutContent>
<SwipeoutActionsLeft>
<SwipeoutAction on:click={() => console.log('Archive clicked')}>
Archive
</SwipeoutAction>
</SwipeoutActionsLeft>
<SwipeoutActionsRight>
<SwipeoutAction onclick={() => console.log('Delete clicked')}>
Delete
</SwipeoutAction>
</SwipeoutActionsRight>
</SwipeoutItem>
</Swipeout>
This example shows how to use the delete functionality with animations. The component supports multiple delete animation styles.
<script>
let items = $state([
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },
{ id: 3, name: 'Item 3' }
]);
function handleDelete(id) {
items = items.filter(item => item.id !== id);
}
</script>
<!-- Default fade animation -->
<Swipeout>
{#each items as item (item.id)}
<SwipeoutItem delete onDelete={() => handleDelete(item.id)}>
<SwipeoutContent>
<div class="item">{item.name}</div>
</SwipeoutContent>
<SwipeoutActionsRight>
<SwipeoutAction
overSwipe
class="bg-red-500"
data-delete="true"
>
Delete
</SwipeoutAction>
</SwipeoutActionsRight>
</SwipeoutItem>
{/each}
</Swipeout>
<!-- With collapse animation -->
<Swipeout class="swipeout-delete-collapse">
<!-- items here -->
</Swipeout>
<!-- With slide animation -->
<Swipeout class="swipeout-delete-slide">
<!-- items here -->
</Swipeout>
<!-- With scale animation -->
<Swipeout class="swipeout-delete-scale">
<!-- items here -->
</Swipeout>
Overswipe actions are triggered when the user swipes past a certain threshold. Perfect for destructive actions like delete.
<Swipeout>
<SwipeoutItem>
<SwipeoutContent>
<div class="item">Swipe me far to trigger overswipe</div>
</SwipeoutContent>
<SwipeoutActionsLeft>
<SwipeoutAction overSwipe class="bg-green-500">
Reply
</SwipeoutAction>
</SwipeoutActionsLeft>
<SwipeoutActionsRight>
<SwipeoutAction overSwipe class="bg-red-500">
Delete
</SwipeoutAction>
</SwipeoutActionsRight>
</SwipeoutItem>
</Swipeout>
You can programmatically close swipeouts using the exported functions:
<script>
import { closeSwipeout, closeAll } from 'svelte-swipeout';
// Close a specific swipeout element
function handleClose(element) {
closeSwipeout(element);
}
// Close all open swipeouts
function handleCloseAll() {
closeAll();
}
</script>
You can customize the colors and styles of the components using CSS variables.
:root {
--swipeout-delete-button-bg-color: #ff3b30;
--swipeout-button-text-color: #fff;
--swipeout-button-padding-vertical: 0;
--swipeout-button-padding-horizontal: 30px;
--swipeout-button-font-size: inherit;
--swipeout-button-font-weight: inherit;
}
You can also use the class prop to add custom classes to the components.
<SwipeoutAction class="my-custom-class">
Delete
</SwipeoutAction>
The root component for the swipeout list.
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | '' | Custom class for the component. |
A single item in the swipeout list. Handles all swipe interactions and animations.
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | '' | Custom class for the component. |
delete | boolean | false | Enable delete functionality with animations. |
onDelete | function | undefined | Callback function when item is deleted (only used when delete is true). |
Events:
swipeout:open - Fired when swipeout starts openingswipeout:opened - Fired when swipeout is fully openedswipeout:close - Fired when swipeout starts closingswipeout:closed - Fired when swipeout is fully closedswipeout:delete - Fired when delete is triggeredswipeout:deleted - Fired after delete animation completesThe content of the swipeout item.
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | '' | Custom class for the component. |
A container for the left swipeout actions.
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | '' | Custom class for the component. |
A container for the right swipeout actions.
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | '' | Custom class for the component. |
A single action button in the swipeout actions.
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | '' | Custom class for the component. |
overSwipe | boolean | false | If true, the action will be triggered when the user swipes past a certain threshold. |
onclick | function | () => {} | A function to be called when the action is clicked. |
data-delete | string | undefined | Set to "true" to mark this as a delete action (used with SwipeoutItem's delete prop). |
The component is fully optimized for mobile devices with:
The component supports multiple delete animation styles that can be applied by adding a class to the Swipeout container:
swipeout-delete-collapse - Fade out with height collapseswipeout-delete-slide - Slide left and collapseswipeout-delete-scale - Scale down and collapseMIT
FAQs
iOS-style swipeable list component for Svelte 5 with delete animations and mobile-optimized touch handling
The npm package svelte-swipeout receives a total of 3 weekly downloads. As such, svelte-swipeout popularity was classified as not popular.
We found that svelte-swipeout demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.