Demo
Linear gauges and the thermometer
Documented in Linear gauge.
Linear gauges and the thermometer
Horizontal and vertical linear gauges with bar and marker pointers, tapered ranges, an annotation, a rounded container and a thermometer bulb.
62 %
Storage, 0 to 100. Used: 62; Warning level: 80.
| Item | Value |
|---|---|
| Used | 62 |
| Warning level | 80 |
| Range Almost full | 80–100 |
Room, -10 to 40. Temperature: 22 °C.
| Item | Value |
|---|---|
| Temperature | 22 °C |
Demo.tsx
'use client';
import { Gauge } from '@salmonui/charts/gauge';
// A horizontal storage gauge and a vertical thermometer.
export default function GaugeLinearDemo() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 24, alignItems: 'flex-start' }}>
<div style={{ inlineSize: 380 }}>
<Gauge
shape="linear"
container="rounded"
title="Storage"
axes={[{ ranges: [{ from: 80, to: 100, color: '#c62828', label: 'Almost full', position: 'outside', width: [2, 8] }], annotations: [{ value: 62, y: -26, content: '62 %' }] }]}
pointers={[{ value: 62, label: 'Used' }, { type: 'marker', value: 80, shape: 'triangle', placement: 'far', label: 'Warning level' }]}
/>
</div>
<div style={{ inlineSize: 120 }}>
<Gauge shape="linear" orientation="vertical" container="thermometer" title="Room" axes={[{ min: -10, max: 40 }]} pointers={[{ value: 22, label: 'Temperature', valueText: (v) => `${v} °C` }]} />
</div>
</div>
);
}
Linear gauges share the circular gauge's axes, ranges and pointers. The data axis never mirrors in right-to-left pages.