UNPKG

@fullstackhouse/react-native-nested-safe-area

Version:

A wrapper on top of react-native-safe-area-context that allows nested safe area contexts

29 lines 1.24 kB
import React from 'react'; import type { EdgeInsets } from 'react-native-safe-area-context'; /** * Represents a safe area edge that can be consumed */ export type Edge = 'top' | 'right' | 'bottom' | 'left'; export interface NestedSafeAreaProviderProps { children: React.ReactNode; /** * Partial insets to subtract from the parent context. * Each specified edge value will be subtracted from the corresponding parent inset. * @example { top: 20, bottom: 10 } // Subtracts 20 from top and 10 from bottom */ consumedInsets?: Partial<EdgeInsets>; /** * List of edges to completely consume (set to zero in nested contexts). * Takes precedence over consumedInsets when both are provided. * @example ['top', 'bottom'] // Completely consumes top and bottom edges */ consumedEdges?: Edge[]; /** * List of edges to reset to the original safe area insets. * Takes precedence over both consumedInsets and consumedEdges. * @example ['top', 'bottom'] // Resets top and bottom to original safe area values */ resetEdges?: Edge[]; } export declare const NestedSafeAreaProvider: React.FC<NestedSafeAreaProviderProps>; //# sourceMappingURL=NestedSafeAreaProvider.d.ts.map