Skip to content

Commit

Permalink
docs: handling safearea
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Aug 23, 2022
1 parent 402ce5e commit 5481ef2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/guides/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"scrollview": "Using ScrollView",
"background": "Background Interaction",
"position": "Position tracking",
"safearea": "Handling SafeArea",
"migrate": "Migrating to v0.8.0"
}
28 changes: 28 additions & 0 deletions docs/pages/guides/safearea.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Handling SafeArea

There are two main props that will come in handy when dealing with `SafeArea` in the action sheet.

The first one is `useBottomSafeAreaPadding`. This prop uses the top padding as a reference to calculate the bottom padding on mobile to Views do not hide under the Navigation Bar.

```tsx
<ActionSheet useBottomSafeAreaPadding />
```

The second one is `drawUnderStatusBar`. This is useful for action sheets that cover full screen. In that case, the sheet will grow under the StatusBar by default. However you can set this to `false` if you don't want that default behavior.

```tsx
<ActionSheet drawUnderStatusBar={false} />
```

If you are using `react-native-safe-area-context` library in your project you can also do the following:

```tsx
const insets = useSafeAreaInsets();

return (
<ActionSheet
containerStyle={{
paddingBottom: insets.bottom,
}}></ActionSheet>
);
```

1 comment on commit 5481ef2

@vercel
Copy link

@vercel vercel bot commented on 5481ef2 Aug 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rnas – ./

rnas-ammarahm-ed.vercel.app
rnas-git-master-ammarahm-ed.vercel.app
rnas.vercel.app

Please sign in to comment.