Status Bar

Status bar web component: a thin app bar for the open file, save state, connection and shortcut hints, with text, button and link items.

  • 2.3 KB gzipped
  • @lit-material/status-bar 1.8.0
  • Renders on the server

Example

Install

npm install @lit-material/status-bar @lit-material/tokens
import "@lit-material/status-bar";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-status-bar>

A thin bar along the bottom of an app window, like an editor's: the open file, the save state, the connection, a shortcut hint. Items go in the default slot (the start) or the end slot; on narrow windows the bar wraps instead of clipping.

Properties

PropertyAttributeTypeDefaultDescription
labellabelstring""The region's accessible name. Unset, "Status", translated.

Slots

SlotDescription
defaultItems at the start.
endItems at the end.

CSS parts

PartDescription
barThe bar.

CSS custom properties

PropertyDescription
--lit-material-status-bar-heightMinimum height (default 28px).
--lit-material-status-bar-backgroundBackground (default --md-sys-color-surface).
--lit-material-status-bar-colorText (default --md-sys-color-on-surface-variant).

<lit-material-status-bar-item>

One item in a lit-material-status-bar: plain text, a button (button), or a link (href). tone colours it and is not colour only: pair it with words ("Unsaved", "2 conflicts"). An optional icon slot goes before the text.

Properties

PropertyAttributeTypeDefaultDescription
buttonbuttonbooleanfalseRenders a <button>.
hrefhrefstring""Renders a link.
tonetoneStatusBarTone"neutral"Colour of the text; say the state in words too.
descriptiondescriptionstring""A longer description (title), e.g. what a button does.

Events

EventDescription
clickThe button was pressed (native).

Slots

SlotDescription
defaultThe text.
iconAn icon before the text.

CSS parts

PartDescription
itemThe span, button or link.

Source on GitHub npm