Skip to content

useSheetPosition ​

A hook that exposes the live position of the action sheet as Reanimated shared values. Use it inside the sheet's content to drive companion animations — parallax headers, collapsing titles, synced backgrounds — entirely on the UI thread.

tsx
import Animated, {useAnimatedStyle} from 'react-native-reanimated';
import {useSheetPosition} from 'react-native-actions-sheet';

function Header() {
  const {y, height, progress} = useSheetPosition();

  const style = useAnimatedStyle(() => ({
    opacity: progress.value,
  }));

  return <Animated.View style={style}>{/* ... */}</Animated.View>;
}

Return value ​

PropertyTypeDescription
ySharedValue<number>The raw translateY of the sheet.
heightSharedValue<number>The measured height of the sheet.
progressSharedValue<number>0 when the sheet is closed → 1 when fully open.

Must be called from a component rendered inside an ActionSheet. It throws if used outside a sheet.

Released under the MIT License.