Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions docs/statusbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ On Android, this will only have an impact on API versions 23 and above.

### `hidden`

If the status bar is hidden.
If the status bar is hidden. Has no effect on iPhone Duo, where the status bar is in a vertical bar.

| Type | Required | Default |
| ------- | -------- | ------- |
Expand All @@ -291,6 +291,16 @@ The transition effect when showing and hiding the status bar using the `hidden`

## Methods

### `getVerticalBarEdgeIOS()` <div className="label ios">iOS</div>

```tsx
static getVerticalBarEdgeIOS(): StatusBarVerticalBarEdgeIOS | null;
```

Get the edge where the system places the vertical bar that holds the status bar beside the content, such as the side rail on iPhone Duo. Returns `null` when the system places no vertical bar, such as on other devices, in orientations that keep the status bar at the top, or before iOS 27.1. To update when the edge changes, use the [`useVerticalBarEdgeIOS`](useverticalbaredgeios) hook.

---

### `popStackEntry()`

```tsx
Expand Down Expand Up @@ -366,7 +376,7 @@ Set the status bar style.
static setHidden(hidden: boolean, animation?: StatusBarAnimation);
```

Show or hide the status bar.
Show or hide the status bar. Has no effect on iPhone Duo, where the status bar is in a vertical bar.

**Parameters:**

Expand Down Expand Up @@ -413,3 +423,20 @@ Status bar style type.
| `'auto'` | string | Automatically picks `light-content` or `dark-content` based on the current color scheme. Updates whenever the color scheme changes. |
| `'light-content'` | string | White texts and icons |
| `'dark-content'` | string | Dark texts and icons (requires API>=23 on Android) |

---

### StatusBarVerticalBarEdgeIOS

The edge where the system places the vertical bar that holds the status bar, such as the side rail on iPhone Duo.

| Type |
| ---- |
| enum |

**Constants:**

| Value | Type | Description |
| ------------ | ------ | ----------------------------------------- |
| `'leading'` | string | The vertical bar is on the leading edge. |
| `'trailing'` | string | The vertical bar is on the trailing edge. |
37 changes: 37 additions & 0 deletions docs/useverticalbaredgeios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
id: useverticalbaredgeios
title: useVerticalBarEdgeIOS
---

```tsx
import {useVerticalBarEdgeIOS} from 'react-native';
```

The `useVerticalBarEdgeIOS` React hook returns the edge where iOS places the vertical bar that holds the status bar beside your content, such as the side rail on iPhone Duo, and updates when it changes, for example when the device rotates or unfolds. Use it to keep custom headers and controls clear of the vertical bar.

### Return values

- `'leading'`: The vertical bar is on the leading edge.
- `'trailing'`: The vertical bar is on the trailing edge.
- `null`: The system places no vertical bar, such as on other devices, in orientations that keep the status bar at the top, before iOS 27.1, or on other platforms.

To read the edge once without subscribing, use [`StatusBar.getVerticalBarEdgeIOS()`](statusbar#getverticalbaredgeios).

---

## Example

```tsx
import {Text, View, useVerticalBarEdgeIOS} from 'react-native';

const App = () => {
const verticalBarEdge = useVerticalBarEdgeIOS();
return (
<View>
<Text>Vertical bar edge: {verticalBarEdge ?? 'none'}</Text>
</View>
);
};

export default App;
```
6 changes: 5 additions & 1 deletion website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ export default {
type: 'category',
label: 'Hooks',
collapsed: false,
items: ['usecolorscheme', 'usewindowdimensions'],
items: [
'usecolorscheme',
'useverticalbaredgeios',
'usewindowdimensions',
],
},
{
type: 'category',
Expand Down
Loading