Overview
TheSafeArea component wraps content with device safe area padding and viewport height constraints. It replaces the common pattern of manually combining useSafeArea() and useViewport() in every resource.
Import
Props
SafeArea accepts all standard <div> props (className, style, ref, etc.) plus:
Content to render inside the safe area.
Usage
What it does
SafeArea renders a <div> with:
paddingTop,paddingBottom,paddingLeft,paddingRightfrom the host’s safe area insets (for notches, status bars, rounded corners)maxHeightfrom the host’s viewport dimensions
style prop. Any additional props (like className) are passed through to the underlying <div>.
Ref forwarding
SafeArea forwards refs to the underlying <div>, so you can use it with useRef: