npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-swipe-action-slider

v0.1.0

Published

WhatsApp style swipe-to-reveal actions slider for React Native lists and rows.

Readme

React Native Swipe Action Slider

A lightweight React Native component that mimics the WhatsApp style swipe-to-reveal actions for list rows. Slide a row horizontally to reveal contextual actions like mute, pin, delete, archive, or custom buttons.

https://user-images.githubusercontent.com/00000000/whatsapp-swipe.gif

Installation

npm install react-native-swipe-action-slider
# or
yarn add react-native-swipe-action-slider

The component has peer dependencies on react and react-native. No additional native modules are required.

Quick Start

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { SwipeActionSlider } from 'react-native-swipe-action-slider';
import { ArchiveIcon, PinIcon, DeleteIcon } from './icons';

const actions = [
  {
    key: 'archive',
    label: 'Archive',
    icon: <ArchiveIcon color="#fff" />,
    backgroundColor: '#0a7cff',
    onPress: () => console.log('Archive'),
  },
  {
    key: 'pin',
    label: 'Pin',
    icon: <PinIcon color="#fff" />,
    backgroundColor: '#3e68ff',
    onPress: () => console.log('Pin'),
  },
  {
    key: 'delete',
    label: 'Delete',
    icon: <DeleteIcon color="#fff" />,
    backgroundColor: '#d93025',
    onPress: () => console.log('Delete'),
  },
];

export const ConversationRow = () => (
  <SwipeActionSlider actions={actions}>
    <View style={styles.row}>
      <Text style={styles.title}>Amna</Text>
      <Text style={styles.preview}>Hey! Can we catch up later today?</Text>
    </View>
  </SwipeActionSlider>
);

const styles = StyleSheet.create({
  row: {
    paddingHorizontal: 16,
    paddingVertical: 14,
    backgroundColor: '#fff',
  },
  title: {
    fontWeight: '600',
    fontSize: 16,
    marginBottom: 4,
  },
  preview: {
    color: '#6b7280',
  },
});

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | actions | SwipeAction[] | [] | Array of actions displayed when the row is swiped. | | children | ReactNode | required | Content of the row. | | style | StyleProp<ViewStyle> | undefined | Wrapper style for the slider container. | | actionContainerStyle | StyleProp<ViewStyle> | undefined | Style override for the revealed actions container. | | actionWidth | number | 72 | Width of each action button. | | maxSwipeDistance | number | actionWidth * actions.length | Maximum distance the row can be dragged. Useful when you want uneven button widths. | | overshoot | number | 16 | Extra distance allowed for rubber-band effect at edges. | | openThreshold | number | 0.35 | Fraction of maxSwipeDistance required to open from closed state. | | closeThreshold | number | 0.3 | Fraction of maxSwipeDistance the user must keep covered to remain open. | | direction | 'left' \| 'right' | 'left' | Direction that reveals the actions. 'left' means swipe towards the left (actions appear on the right). | | onSwipeStart | () => void | undefined | Fired when the user starts dragging. | | onSwipeEnd | (isOpen: boolean) => void | undefined | Fired when the slider settles open or closed. | | friction | number | 12 | Spring friction used when animating to the resting position. | | tension | number | 120 | Spring tension used when animating to the resting position. |

export type SwipeAction = {
  key: string;
  label?: string;
  icon?: React.ReactNode;
  onPress: () => void;
  backgroundColor?: string;
  textStyle?: StyleProp<TextStyle>;
  testID?: string;
};

Tips

  • Wrap list rows with the slider inside FlatList / SectionList render items.
  • Keep actionWidth values consistent for a polished feel.
  • Use vector icons for the best performance and clarity on high DPI screens.
  • Call onSwipeEnd to close other rows when one opens.

Roadmap

  • Left-to-right swipe demos
  • RTL support & layout testing
  • Expanded accessibility: voiceover labels & hints

Contributions and feedback are welcome!