React Native · Expo SDK 57 New
Glass Swipe Row
A row whose actions follow a swipe and spring into place, with a labelled action button and selection haptics.
npx shadcn@4.14.1 add @glassyui-native/glass-swipe-rowInstallation
Install Glass Swipe Row
npx shadcn@4.14.1 add @glassyui-native/glass-swipe-row
npx expo install --fixRebuild your development build after adding native modules. The Expo guide covers the registry and glass provider.
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>
);
}
API
| Prop | Type | Use |
|---|---|---|
label | string | Names the row in the action button. |
children | ReactNode | The row content. |
actions | GlassSwipeAction[] | Each action has id, label, onPress, and optional destructive. |
haptics | boolean | Defaults to true on native platforms. |
Each component also accepts style and testID.
Notes
- Swipe left to reveal actions. The action button provides the same choices without a swipe. Swiping never invokes an action by itself.
- Wrap the app in GestureHandlerRootView, above GlassProvider. In a native Modal, wrap its contents too.
- Reduce Motion removes spring settling. Selection haptics run on iOS and Android when the action panel opens; haptics={false} disables them.