Skip to content

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); 0 on desktop — use height for an explicit value
  • color follows 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

9:41

Foreground Color ​

Preset color / arbitrary CSS color

blue presetorange presetCSS variable color

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

9:41
Dark page content

API ​

oas-status-bar ​

Attributes ​

AttributeDescriptionTypeDefault
colorForeground 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 defaultstring—
heightHeight override: plain numbers are px, CSS lengths are accepted (44px / 1.5rem); defaults to env(safe-area-inset-top)string—

Slots ​

NameDescription
defaultStatus content (time / battery drawn by the host)

CSS Variables ​

CSS VariableDescriptionDefault
--oas-status-bar-bgBackground (transparent by default; the host decides whether to paint it)transparent
--oas-status-bar-colorForeground color (the color attribute writes the same variable)var(--oas-color-text-primary)
--oas-status-bar-heightHeight override (the height attribute writes the same variable)env(safe-area-inset-top, 0px)

Released under the MIT OR Apache-2.0 License.