Skip to content

@jsvision/ui / statusLine

Function: statusLine()

statusLine(children): StatusLine

Defined in: ui/src/status/statusline.ts:205

Build a StatusLine from a heterogeneous list of views: command items (statusItem), flexible spacer()s, and any fitting 1-row passive widget. This only assembles the row; the application wires up behaviour when you pass the line to createApplication.

Parameters

children

View[]

The status children, laid out left-to-right in order.

Returns

StatusLine

A constructed StatusLine.

Example

ts
import { createApplication, statusLine, statusItem, spacer, Commands, ProgressBar, signal } from '@jsvision/ui';
import { resolveCapabilities } from '@jsvision/core';

const value = signal(0.5);
const status = statusLine([
  statusItem('~Alt-X~ Exit', Commands.quit, 'Alt+X'),
  spacer(),                               // fill — pushes the widgets to the right
  new ProgressBar({ value }),             // an embedded passive widget
  statusItem(() => new Date().toLocaleTimeString()), // a live, command-less clock
]);
const app = createApplication({ caps: resolveCapabilities().profile, statusLine: status });