StatusBar
Reserves the top status-bar height (env(safe-area-inset-top)) for pages embedded in a mobile host, with height and foreground-color overrides. The component does not emulate the system status bar — the host container (web view / native shell) owns it; this component only prevents content from being covered and lets the foreground color follow the page theme.
- Default height =
env(safe-area-inset-top);0on desktop — useheightfor an explicit value colorfollows ui-spec §4.1: the 11 preset names resolve to--oas-preset-*-text(text-safe tier); any other CSS color is injected as-is- The default slot holds host-drawn time / battery content
Basic Usage
height=44 with time content
Example
Foreground Color
Preset color / arbitrary CSS color
Example
Dark Theme
The default foreground uses --oas-color-text-primary and the background is controlled by --oas-status-bar-bg; nothing extra is needed in dark mode. The demo previews a locally scoped dark theme:
data-theme=dark local preview
Dark page content
Example
API
oas-status-bar
Attributes
| Attribute | Description | Type | Default |
|---|---|---|---|
color | Foreground override (ui-spec §4.1): the 11 preset names resolve to --oas-preset-<name>-text; any other CSS color is injected as-is; empty restores the token default | string | — |
height | Height override: plain numbers are px, CSS lengths are accepted (44px / 1.5rem); defaults to env(safe-area-inset-top) | string | — |
Slots
| Name | Description |
|---|---|
| default | Status content (time / battery drawn by the host) |
CSS Variables
| CSS Variable | Description | Default |
|---|---|---|
--oas-status-bar-bg | Background (transparent by default; the host decides whether to paint it) | transparent |
--oas-status-bar-color | Foreground color (the color attribute writes the same variable) | var(--oas-color-text-primary) |
--oas-status-bar-height | Height override (the height attribute writes the same variable) | env(safe-area-inset-top, 0px) |