Safe Area View
A lightweight wrapper that applies env(safe-area-inset-*) padding (or margin) so UI clears iOS notches, status bars, and the home indicator.
Basic Usage
Respecting the notch and home indicator
SafeAreaView applies env(safe-area-inset-*) padding so your UI clears iOS notches and home bars. The mock device on the right shows the simulated effect using inline insets.
import { SafeAreaView } from 'fluxo-ui';
<SafeAreaView edges={['top', 'bottom']} fillBackground>
{/* page content */}
</SafeAreaView>Edges & Modes
Targeted edges
Pass any combination of 'top' | 'right' | 'bottom' | 'left' | 'horizontal' | 'vertical' | 'all'. The wrapper applies env(safe-area-inset-*) only to the chosen edges.
Padding vs margin
Use mode='margin' when you want the wrapper itself to sit inside the safe area without nudging its inner padding.
<SafeAreaView edges="top" mode="padding">Header area</SafeAreaView>
<SafeAreaView edges={['bottom', 'horizontal']} mode="margin">…</SafeAreaView>
<SafeAreaView edges="all" as="main" fillBackground>…</SafeAreaView>Import
import { SafeAreaView } from 'fluxo-ui';
import type { SafeAreaViewProps, SafeAreaEdge, SafeAreaMode } from 'fluxo-ui';Props
edgesSafeAreaEdge | SafeAreaEdge[]"'all'"Which insets to apply. Supports 'top' | 'right' | 'bottom' | 'left' | 'all' | 'horizontal' | 'vertical', or an array of those.
edgesSafeAreaEdge | SafeAreaEdge[]"'all'"Which insets to apply. Supports 'top' | 'right' | 'bottom' | 'left' | 'all' | 'horizontal' | 'vertical', or an array of those.
mode'padding' | 'margin'"'padding'"Apply the insets as padding (default) or margin.
mode'padding' | 'margin'"'padding'"Apply the insets as padding (default) or margin.
askeyof JSX.IntrinsicElements"'div'"HTML element to render as (e.g., 'main', 'section', 'header', 'footer').
askeyof JSX.IntrinsicElements"'div'"HTML element to render as (e.g., 'main', 'section', 'header', 'footer').
fillBackgroundboolean"false"Apply the theme background to the wrapper so notch areas look consistent.
fillBackgroundboolean"false"Apply the theme background to the wrapper so notch areas look consistent.
childrenReactNodeContent rendered inside the safe area wrapper.
childrenReactNodeContent rendered inside the safe area wrapper.
classNamestringAdditional CSS class for the wrapper.
classNamestringAdditional CSS class for the wrapper.
Features
env(safe-area-inset-*)
Reads native iOS safe-area insets via the standard CSS env() values.
Per-edge control
Apply to any combination: top / right / bottom / left / horizontal / vertical / all.
Padding or margin
mode="padding" (default) pushes content inward; mode="margin" pushes the wrapper itself.
Polymorphic
Render as any element via as= ('main', 'section', 'header', 'footer', …).
Optional fill background
Set fillBackground to extend --eui-bg behind the wrapper so notch areas look consistent.
Zero JS overhead
Purely CSS variables — no resize observers or measurement work.