One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

Safe Area

The One.UI.SafeArea keys for native insets

One.UI.SafeArea is One’s shared safe area API. Full props and examples live under SafeAreaView; this page maps its three keys.

KeyWhat it is
Providerhosts the native safe area provider
Viewlays out within the safe area boundaries (mode padding or margin, edges to scope)
initialMetricsthe first window metrics, for seeding layout before the provider reports

The hooks are named exports from one: useSafeAreaInsets reads { top, right, bottom, left } in pixels for custom layouts, and useSafeAreaFrame reads the current window frame.

It uses One’s native host on iOS and Android and CSS environment insets on web, with no separate safe area package in your app.

import { useSafeAreaInsets } from 'one'
function Padded() {
const insets = useSafeAreaInsets()
return <Content style={{ paddingTop: insets.top }} />
}

Tamagui reads the same insets. One’s root provider feeds them to Tamagui’s native safe area state, so safe style values and the $safe-area-* variables resolve on iOS and Android without importing @tamagui/native/setup-safe-area, and they follow rotation.

Edit this page on GitHub.