SafeArea
A container that applies safe area insets as padding or margin, ensuring content is not hidden behind system UI such as the home indicator on iOS or the navigation bar on Android.
You can pass in custom classes and styles just like a regular div, so we recommend using it in place of your usual top-level wrapper.
When no edges prop is specified, all four edges are applied. If you only need a specific edge, for example a sticky footer, use edges={["bottom"]}.
Anchor to propsProps
- Anchor to childrenchildrenchildrenReact.ReactNodeReact.ReactNode
Content to render inside the safe area
- Anchor to classNameclassNameclassNamestringstring
Additional CSS classes
- Anchor to edgesedgesedgesEdge[]Edge[]
Which edges to apply safe area insets to. Defaults to all edges.
- Anchor to modemodemode'padding' | 'margin''padding' | 'margin'
Whether to apply insets as padding or margin. Defaults to 'padding'.
- Anchor to stylestylestyleReact.CSSPropertiesReact.CSSProperties
Additional inline styles
Edge
'top' | 'right' | 'bottom' | 'left'Was this page helpful?