PopoutRootView
is a React component that serves as the root view for the popout transition. It should wrap the main content of your app.
children
: ReactNode - The main content of your app.
import PopoutRootView from "<your-library-name>";
// In your component's render method:
<PopoutRootView>{/* Your app's content */}</PopoutRootView>;
PopoutTile
is a React component that represents a tile in the popout transition.
children
: ReactNode - The content of the tile.style
: Object - The style object for the tile.
import { PopoutTile } from "<your-library-name>";
// In your component's render method:
<PopoutTile style={{ width: 100, height: 100 }}>
{/* Your tile's content */}
</PopoutTile>;
PopoutContext
is a React context that provides the state and actions for the popout transition.
elementOpened
: PopoutTileType | null - The currently opened popout tile, or null if no tile is opened.onElementTap
: Function - A function to be called when a popout tile is tapped. It receives a reference to the Animated.View and the tapped PopoutTileType item.OverlayComponent
: React.ComponentType | null - The component to be rendered as an overlay, or null if no overlay should be rendered.setOverlayComponent
: Function - Function to set the OverlayComponent. It receives a React.ComponentType or null.overlayUnderNotch
: boolean - Boolean indicating whether the overlay should be rendered under the notch.setOverlayUnderNotch
: Function - Function to set the overlayUnderNotch property. It receives a boolean.
import { useContext } from "react";
import { PopoutContext } from "react-native-popout";
// In your component:
const {
elementOpened,
onElementTap,
OverlayComponent,
setOverlayComponent,
overlayUnderNotch,
setOverlayUnderNotch,
} = useContext(PopoutContext);