Skip to content

SegmentDisplay

Renders a fixed-width line of 14-segment cells. Updating text never replaces the cell nodes, and illumination changes are instantaneous without CSS animation.

ts
import { SegmentDisplay } from '@haskou/vfd-console';
import '@haskou/vfd-console/css';

const display = new SegmentDisplay(document.querySelector('#title')!, {
  ariaLabel: 'Track title',
  cells: 12,
  color: 'primary',
});

display.setText('VFD CONSOLE');
display.setAccessibleLabel('Track title: VFD Console');

Options

OptionTypeDescription
cellsnumberRequired positive cell count.
ariaLabelstringAccessible display name.
colorVfdColorPhosphor color for every cell.

Methods

setText(text), clear(), test(), cell(index) and setAccessibleLabel(label).

Use test() for a display test. It illuminates every segment without changing the permanent geometry.