INNER CODE UNIT · TypeScript

getEnteringTranslateY

gunnartorfis/sonner-native-toasts · src/animation-utils.ts:3

export const getEnteringTranslateY = (position: ToastPosition): number => {
  'worklet';
  if (position === 'top-center') {
    return -20;
  }

  // bottom-center and center share the same enter direction (slide up from below)
  return 50;
};

export const getExitingTranslateY = ({
  position,
  isHiddenByLimit,
  numberOfToasts,
  stackGap,
}: {
  position: ToastPosition;
  isHiddenByLimit?: boolean;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…