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

expo-swipeable-item

v0.1.1

Published

Swipeable item for flatlist

Readme

expo-swipeable-item

A high-performance, gesture-driven swipeable item component for Expo and React Native apps, built on Reanimated and React Native Gesture Handler. Perfect for implementing intuitive swipe interactions in FlatList or standalone views.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install expo-swipeable-item

Important

the library uses react-native-reanimated and react-native-gesture-handler So , before you get started you should wrap your App with

npx expo install react-native-gesture-handler
<GestureHandlerRootView style={{ flex: 1 }}>
  <App />
</GestureHandlerRootView>

Props

| Name | Type | Description | | :------------- | :---------------------- | :---------------------------------------------- | | children | React.ReactNode | The content to swipe. | | leftButtons | React.ReactNode[] | buttons on left side. | | rightButtons | React.ReactNode[] | buttons on left side. | | style | ViewStyle/ViewStyle[] | style of child component's wrapper | | enabled | boolean | enables / disables swipe | | onSnap | () => void | Called when item is swiped (on start of swipe). | | onPress | () => void | Called when item is pressed. | | swipeSides | left/right/both | Swipe sides. | | buttonWidth | number | width of single button |

Methods

| Name | Type | Description | | :--------------- | :--------- | :--------------- | | closeSwipeable | () => {} | closes swipeable |

Example

Screen Recording 2025-04-07 at 13 14 00

  import { SwipeableView, SwipeableViewRef } from "expo-swipeable-item";

  ...

  const leftButtons = useMemo(
    () => [
      <TouchableOpacity key="left-1" style={[styles.smallButton, styles.red]}>
        <Ionicons name="heart" size={24} color="white" />
        <Text style={styles.buttonText}>Favourite</Text>
      </TouchableOpacity>,
      <TouchableOpacity key="left-2" style={[styles.smallButton, styles.green]}>
        <Ionicons name="pin" size={24} color="white" />
        <Text style={styles.buttonText}>Pin</Text>
      </TouchableOpacity>,
    ],
    []
  );

  const rightButtons = useMemo(
    () => [
      <TouchableOpacity
        key="right-1"
        style={[styles.smallButton, styles.lightBrown]}
      >
        <Ionicons name="volume-mute" size={24} color="white" />
        <Text style={styles.buttonText}>Mute</Text>
      </TouchableOpacity>,
      <TouchableOpacity key="right-2" style={[styles.smallButton, styles.red]}>
        <Ionicons name="trash" size={24} color="white" />
        <Text style={styles.buttonText}>Delete</Text>
      </TouchableOpacity>,
    ],
    []
  );

  const renderItem = useCallback(
    ({ item }: { item: ListItem }) => (
      <View style={styles.item}>
        <SwipeableView
          ref={(ref) => (itemRefs.current[item.id] = ref)}
          enabled
          swipeSides="both"
          buttonWidth={buttonWidth}
          leftButtons={leftButtons}
          rightButtons={rightButtons}
        >
          <View style={styles.itemContent}>
            <Text style={styles.itemText}>{item.text}</Text>
          </View>
        </SwipeableView>
      </View>
    ),
    [leftButtons, rightButtons, buttonWidth]
  );

...


 <GestureHandlerRootView style={styles.rootView}>
    <SafeAreaView style={styles.container}>
      <FlatList
        data={data}
        renderItem={renderItem}
        contentContainerStyle={styles.contentContainer}
        keyExtractor={(item) => item.id}
      />
      <View style={styles.buttonContainer}>
        <TouchableOpacity style={styles.button} onPress={closeAllItems}>
          <Text>Close all</Text>
          </TouchableOpacity>
          <TouchableOpacity style={styles.button} onPress={closeFirstItem}>
            <Text>Close first</Text>
          </TouchableOpacity>
      </View>
    </SafeAreaView>
  </GestureHandlerRootView>

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.