cap-go avatar

Safe Area Handling

Handles the notch, Dynamic Island, home indicator, and display cutouts so your Capacitor app doesn't put content where users can't see it. The guide covers CSS environment variables like safe-area-inset-top with proper viewport-fit=cover setup, plus JavaScript solutions for reading insets dynamically and React/Vue hooks if you need programmatic control. It's especially helpful when building tab bars or full-bleed layouts where you want background colors to extend to screen edges but interactive elements to stay in safe zones. The examples are complete enough to drop into real projects, and it covers both portrait and landscape orientation changes.

skills.sh installs
203
GitHub stars
43
last updated
Jun 3, 2026

Install

$ npx -y skills add cap-go/capacitor-skills --skill safe-area-handling --agent claude-code

Installs into .claude/skills of the current project.

Files

Safe Area Handling in Capacitor

When to Use

TRIGGER when:

  • Content renders under the status bar, notch, Dynamic Island, cutout, home indicator, or Android navigation/gesture bar
  • env(safe-area-inset-*) is 0px on Android, or correct only after rotation
  • Layout broke after Capacitor 8 upgrade or raising targetSdkVersion to 35/36
  • StatusBar.setOverlaysWebView / setBackgroundColor stopped working on Android
  • Landscape / split-screen / iPad windowed layouts have wrong side padding

Do not use:

  • Keyboard covering inputs: capacitor-keyboard
  • Ionic ion-header/ion-toolbar theming: ionic-design; Konsta safeAreas: konsta-ui
  • Tailwind plugin/utility setup: tailwind-capacitor
  • iOS scene sizing, UIScreen.main, multi-window: capacitor-ios-resizability
  • Splash screen colors: capacitor-splash-screen

Facts that drive every decision

Sponsors

Details

Repository
github.com/cap-go/capacitor-skills
Category
Mobile Development
First seen
Jun 3, 2026

More from cap-go/capacitor-skills

All 13
1entropyconquers avatarreanimated-dndentropyconquers/react-native-reanimated-dndreanimated dnd198skills.sh installs
2limrun-inc avatarlimrun-detox-testinglimrun-inc/skillsConfigure, run, or debug Detox on Limrun iOS simulators. Use when attaching the Limrun Detox runtime to an app, wiring Detox mediator connectivity, or validatin44.5Kskills.sh installs
3limrun-inc avatarlimrun-maestro-testinglimrun-inc/skillsRun Maestro YAML flows against a Limrun cloud iOS simulator with `lim ios maestro`, from any environment (Linux, Windows, macOS, VM, container). Use when the us42.6Kskills.sh installs
4software-mansion avatarargent-tv-interactsoftware-mansion/argentControl and inspect TV apps via argent — Apple TV (tvOS), Android TV (leanback), and Amazon Fire TV (Vega). Boot the target, read focus, navigate with the D-pad24.5Kskills.sh installs
5heroui-inc avatarheroui-nativeheroui-inc/herouiHeroUI Native component library for React Native (Tailwind v4 via Uniwind). Use when building mobile UIs with HeroUI Native — creating Buttons, Cards, TextField11.2Kskills.sh installs
6manaflow-ai avatarcmux-custom-sidebarmanaflow-ai/cmuxBuild a custom cmux sidebar from a plain-language request. Use when the user asks for a custom sidebar, a sidebar that shows their workspaces/tabs/PRs/clock, a 5Kskills.sh installs