Skip to content

Meter

widgetsdata

Meter: a self-contained metric display with label, bar, and value with low/optimum/high thresholds

Installation

$ bunx termuijs add meter

Copies the source into src/components/meter/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { Meter } from '@termuijs/widgets'
ts
new Meter(label: string, style: Partial<Style> = {}, opts: MeterOptions = {})

API Reference

Meter

PropTypeRequiredDescription
labelstringrequired
lownumberoptionalValue below this fraction renders the low color
highnumberoptionalValue at or above this fraction renders the high color
showLabelbooleanoptionalShow the percentage label
#data#meter