Radical
Reference

Safe-area API

Initial document CSS, component state, and scoped subscriptions.

Insets and document styles

API or valueContract
SafeAreaFinite, nonnegative top, right, bottom, left in CSS pixels; excludes keyboard height
safeAreaStyle(context?, mode = "remote")Returns --radical-safe-area-top, --radical-safe-area-right, --radical-safe-area-bottom, --radical-safe-area-left
Remote native contextPixel strings
Browser, bundled, or absent loader contextenv(safe-area-inset-*, 0px) for stable hydration
watchSafeArea(receive)Effect requiring Bridge | Scope; returns cleanup and registers it for scope closure
Native eventsradicalSafeArea; malformed inset events ignored
Browser observationMeasures CSS env() insets; listens for resize
useSafeArea()Initial provider insets, then live values; no loading or error state

Platform support

CapabilityAndroidiOSBrowser
Live insetsShell CSS updates at document start and later changesShell CSS updates at document start and later changesCSS environment insets and resize events
KeyboardLayout viewport resizesFocused input scrolls into viewBrowser layout behavior
EnablementNo capability flag or extra dependencyNo capability flag or extra dependencyNo native dependency

Exports

ExportEntry points
safeAreaStyle@akshatowo/radical/client, @akshatowo/radical/server, @akshatowo/radical/native-context
watchSafeArea@akshatowo/radical/client
useSafeArea@akshatowo/radical/react

Source: safe-area implementation, safe-area contract.

On this page