Browse docsSwipe Row

React Native · Expo SDK 57 New

Glass Swipe Row

A row that reveals action buttons on swipe, for iOS, Android and the web.

Requires GestureHandlerRootView from react-native-gesture-handler around your app, and around the contents of any native Modal.

Installation

For Expo SDK 57 or later.

Add a components.json to your app first, as the Expo guide shows.

npx shadcn@4.14.1 add @glassyui-native/glass-swipe-row && npx expo install --fix

Adds 12 files to components/glassyui, then matches react-native-gesture-handler, react-native-reanimated, react-native-worklets, expo-haptics, expo-blur and expo-glass-effect to your Expo SDK. Rebuild your development build after adding native packages.

Usage

Glass Swipe Row usage

import { useState } from 'react';
import { Text, View } from 'react-native';
import { useGlassTheme } from '@/components/glassyui/glass-provider';
import { GlassSwipeRow } from '@/components/glassyui/glass-swipe-row';

export default function SwipeRowExample() {
  const { colors } = useGlassTheme();
  const [result, setResult] = useState('Ready');

  return (
    <View style={{ gap: 12 }}>
      <GlassSwipeRow
        label="Design review"
        actions={[
          { id: 'pin', label: 'Pin', onPress: () => setResult('Pinned') },
          { id: 'archive', label: 'Archive', onPress: () => setResult('Archived') },
        ]}
        testID="native-swipe-row"
      >
        <Text style={{ color: colors.foreground, fontSize: 17 }}>Design review</Text>
        <Text style={{ color: colors.mutedForeground, fontSize: 14 }}>Today, 10:00</Text>
      </GlassSwipeRow>
      <Text style={{ color: colors.foreground }} testID="native-swipe-value">
        {result}
      </Text>
    </View>
  );
}

It also uses Glass Provider. Install them together:

npx shadcn@4.14.1 add @glassyui-native/glass-swipe-row @glassyui-native/glass-provider && npx expo install --fix

API reference

GlassSwipeRow

A glass row with an Actions button; swiping or the button reveals the actions.

PropTypeDefaultDescription
childrenRequiredReactNodeNoneThe row content.
labelRequiredstringNoneNames the row in the Actions button's accessible name.
actionsRequiredreadonly GlassSwipeAction[]NoneRevealed buttons, each { id, label, onPress, destructive? }; an empty array turns swiping off.
hapticsbooleantruePlays a selection haptic when the actions open, on iOS and Android.
styleStyleProp<ViewStyle>NoneApplies to the outer view.
testIDstringNoneSet on the outer view.
Types
GlassSwipeRowPropsGlassSwipeAction
Accessibility
Closed actions are hidden from assistive technology, and the Actions button opens them without a swipe.