Skip to main content

Properties

Required

child
Widget
required
The widget to wrap with safe area padding.

Layout

left
bool
default:"true"
Whether to apply safe area padding to the left side.
top
bool
default:"true"
Whether to apply safe area padding to the top side.
right
bool
default:"true"
Whether to apply safe area padding to the right side.
bottom
bool
default:"true"
Whether to apply safe area padding to the bottom side.

Behavior

onlySafeWhenSidebarHidden
bool
default:"true"
Whether to use sidebar-aware padding behavior. When true, uses medium spacing when sidebar is visible and system safe area when hidden. When false, always uses system safe area padding.

Best Practices

  • Sidebar Integration: When using with NeoSidebarLayout, the default onlySafeWhenSidebarHidden: true provides optimal spacing that adapts to sidebar state.
  • Selective Padding: Use the directional properties (left, top, right, bottom) to fine-tune which sides receive safe area treatment based on your layout needs.
  • Root Level Usage: Place NeoSafeArea at the root of your screen content to ensure proper spacing from system UI elements like status bars and navigation areas.

Integration Notes

  • Sidebar Detection: Automatically detects sidebar visibility state and adjusts padding accordingly with smooth animations.
  • System Integration: Respects system safe areas (notches, dynamic islands, navigation bars) when appropriate.
I