Project React Native Reanimated Modal

Type Aliases§

Source§

type ModalAnimation = "fade" | "slide" | "scale"

Source§

type ModalAnimationConfig<T> = T extends "fade"
    ? FadeAnimationConfig
    : T extends "slide"
        ? SlideAnimationConfig
        : T extends "scale" ? ScaleAnimationConfig : never

Generic type for animation config based on animation type.

Source§

type ModalAnimationConfigUnion = FadeAnimationConfig | SlideAnimationConfig | ScaleAnimationConfig

Union of all animation configuration types.

Source§

type SwipeDirection = "up" | "down" | "left" | "right"

Variables§

Source§

const DEFAULT_MODAL_ANIMATION_CONFIGS: {
    fade: FadeAnimationConfig;
    scale: ScaleAnimationConfig;
    slide: SlideAnimationConfig;
} = ...

Default animation configurations.

Source§

const DEFAULT_MODAL_ANIMATION_DURATION: 300 = [object Object]

Default values and configurations.

Source§

const DEFAULT_MODAL_BACKDROP_COLOR: "black" = 'black'

Source§

const DEFAULT_MODAL_BACKDROP_OPACITY: 0.7 = [object Object]

Source§

const DEFAULT_MODAL_BOUNCE_OPACITY_THRESHOLD: 0.05 = [object Object]

Source§

const DEFAULT_MODAL_BOUNCE_SPRING_CONFIG: { dampingRatio: 0.5; duration: 700; stiffness: 200 } = ...

Source§

const DEFAULT_MODAL_SCALE_FACTOR: 0.8 = [object Object]

Source§

const DEFAULT_MODAL_SWIPE_CONFIG: SwipeConfig = ...

Default swipe configuration.

Source§

const DEFAULT_MODAL_SWIPE_DIRECTION: SwipeDirection = 'down'

Source§

const DEFAULT_MODAL_SWIPE_THRESHOLD: 100 = [object Object]

Source§

const Modal: FC<ModalProps> = ...

Modal component with smooth, customizable animations and gesture support. Built on top of React Native's Modal, Reanimated, and Gesture Handler.

props

Props for the modal component.

Functions§

Source§

getSlideInDirection(
    animationConfig: ModalAnimationConfigUnion,
    fallback?: SwipeDirection,
): SwipeDirection

Gets the slide-in direction from animation config.

Source§

getSwipeDirections(
    swipeConfig: SwipeConfig,
    animationConfig?: ModalAnimationConfigUnion,
    fallback?: SwipeDirection | SwipeDirection[],
): SwipeDirection[]

Extracts swipe directions from swipe config or animation config fallback.

Source§

normalizeAnimationConfig(
    config?: undefined | ModalAnimation | Partial<ModalAnimationConfigUnion>,
): ModalAnimationConfigUnion

Normalizes animation configuration by providing defaults for missing properties.

Source§

normalizeSwipeConfig(config?: Partial<SwipeConfig>): SwipeConfig

Normalizes swipe configuration by providing defaults for missing properties.

Interfaces§

FadeAnimationConfig

Configuration for fade animation.

ModalProps

Props for the Modal component.

ScaleAnimationConfig

Configuration for scale animation.

SlideAnimationConfig

Configuration for slide animation.

SwipeConfig

Configuration for swipe gestures.