> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Status bar

> Control the color and style of the device status bar in your app, and change them at runtime with the JavaScript Bridge.

Set default styling options and the light or dark style for the device status bar while your app is open. In Light mode, the status bar displays black text. In Dark mode, it displays white text. In Auto mode, it follows the device's light or dark mode setting.

You can also set the status bar visibility and style at runtime from your website using the Median JavaScript Bridge.

> [!TIP]
>
> **Test  with our demo page**
>
> We host a ready-made demo page at
>
> that calls the  features through the Median JavaScript Bridge.
> Load it inside your Median app during development, either by setting it
> as your app's website URL in App Studio or by navigating to it from your
> own site, and use it to confirm  works on a real device before
> you add it to your own pages.
>
> The demo page only works inside a Median app with  enabled.
> Opened in a regular mobile or desktop browser, the native features
> won't respond. Remember to switch your app back to your own URL before
> release.

## Configuration options

Median supports four parameters for controlling status bar appearance:

| Parameter | Values | Description |
| - | - | - |
| `style` | `'light'`, `'dark'` or `'auto'` | Sets the color of the status bar text and icons. `light` displays black text/icons; `dark` displays white text/icons; `auto` follows the device's system light or dark mode setting. |
| `color` | Hex value, e.g. `RRGGBB` or `AARRGGBB` | Sets the status bar background to a solid color. Use `00000000` for a fully transparent status bar. |
| `overlay` | `true` or `false` | When `true`, web content extends underneath the status bar. When false (default), web content starts below the status bar. |
| `blur` | `true` or `false` (iOS only) | When `true`, applies a blur effect behind the status bar color. When `false` (default), the status bar shows a flat, solid color. |

> [!WARNING]
>
> **Overlay setting on Android**
>
> With the Overlay setting enabled on Android, the keyboard overlays your web content, which can cause issues for users completing forms. If you use forms in your app, consider one of these solutions:
>
> 1. Disable the Overlay setting via the JavaScript Bridge when showing a page that includes forms.
> 2. Make use of the [keyboard listener functions](https://docs.median.co/docs/keyboard-state-tracking.md) to disable/enable the Overlay setting via the JavaScript Bridge when the keyboard is active/inactive.

> [!TIP]
>
> **Use your AI agent**
>
> Use the Median MCP with your AI agent to change the status bar style and background colors. See
> [Median MCP server](https://docs.median.co/docs/mcp-server.md) to set it up.

## Setting the status bar at runtime

Use the JavaScript Bridge to update the status bar dynamically, either in response to user actions or automatically on page load.

### Option 1: Auto-match the status bar to your page background

To have Median automatically detect your webpage's background color and apply it to the status bar, call the built-in helper function when the library loads. If you use the `median-js-bridge` npm package, call `Median.statusbar.matchBodyBackgroundColor({ active: true })` instead.

Median JavaScript Bridge

```javascript JavaScript theme={null}
function median_library_ready() {
  median_match_statusbar_to_body_background_color();
}
```

### Option 2: Set custom status bar styles

For full control, call `median.statusbar.set()` with your desired parameters. This is useful for apps that need different status bar treatments for different content types (for example, a red status bar over a video player).

The example code below creates a red status bar with 50% alpha and white icons, and has the web content extend underneath the status bar.

Median JavaScript Bridge

```javascript JavaScript theme={null}
// Trigger on demand, e.g. from a button or route change
if (navigator.userAgent.indexOf("median") > -1) {
  median.statusbar.set({
    style: "dark", // white text and icons
    color: "80ff0000", // 50% alpha red
    overlay: true,
    blur: true, // optional, iOS only
  });
}

// Or apply automatically when the app loads
function median_library_ready() {
  median.statusbar.set({
    style: "dark",
    color: "80ff0000",
    overlay: true,
    blur: true,
  });
}
```


## Related topics

- [Full screen](https://docs.median.co/docs/full-screen.md)
- [Change navigation at runtime](https://docs.median.co/docs/navigation-runtime-api.md)
- [Custom CSS](https://docs.median.co/docs/custom-css.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.