Skip to content

@jsvision/ui / statusItem

Function: statusItem()

statusItem(text, command?, key?): StatusItemView

Defined in: ui/src/status/status-item.ts:146

Build a status entry for a statusLine. command is optional — omit it for a passive label; text may be a live () => string getter that repaints itself on change.

Parameters

text

string | (() => string)

The display label, or a () => string getter; ~X~ marks the accent character.

command?

string

Optional command emitted when the item is clicked or its accelerator is pressed.

key?

string

Optional accelerator label, e.g. 'Alt+X' or 'F4'.

Returns

StatusItemView

A StatusItemView ready to drop into statusLine.

Example

ts
import { statusItem, Commands } from '@jsvision/ui';

const exit = statusItem('~Alt-X~ Exit', Commands.quit, 'Alt+X');
const hint = statusItem('~Tab~ Switch panes'); // passive: no command