Skip to main content

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 children
children
React.ReactNode

Content to render inside the safe area

Anchor to className
className
string

Additional CSS classes

Anchor to edges
edges
[]

Which edges to apply safe area insets to. Defaults to all edges.

'padding' | 'margin'

Whether to apply insets as padding or margin. Defaults to 'padding'.

Anchor to style
style
React.CSSProperties

Additional inline styles


Was this page helpful?