ValyroUI English version

Meter

Измерение на шкале с цветом по порогам: хранилище, заряд, надёжность. Бесплатно, MIT · Данные и показатели › Показатели и виджеты

Установка

npx valyro-cli@latest add meter
npx shadcn@latest add https://valyro.xyz/r/meter.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Meter } from 'valyro-ui';

Пропсы

PropTypeDefault
value *numberThe measured value, clamped to min…max.
minnumberLower end of the scale (default 0).
maxnumberUpper end of the scale (default 100; never below min).
lownumberUpper bound of the low region, as on the HTML <meter>.
highnumberLower bound of the high region, as on the HTML <meter>.
optimumnumberThe best value. With low / high it decides the colour: an optimum below low means "less is better" (storage, quotas), above high "more is better" (battery, password strength).
color'auto' | 'accent' | 'success' | 'warning' | 'danger' | 'neutral''auto'auto follows the region of the value when thresholds are set (else the accent); any other value fixes the colour.
labelReactNodeVisible caption above the bar; also names the meter unless aria-label is given.
showValuebooleanfalseShow the value next to the label.
formatValue(value: number, min: number, max: number) => stringCustom value text (shown and announced), e.g. "7.4 of 10 GB".
localestringLocale for the percentage (default: the ThemeProvider's, then the browser's).
size'sm' | 'md' | 'lg''md'Bar thickness.
showThresholdsbooleanfalseTick marks at low and high on the track.
labelsPartial<MeterLabels>Status words added to the announced value when thresholds are set.

Похожие компоненты

  • Stats Card — Карточки показателей
  • KPI Group — Ряд KPI: значение, изменение к прошлому периоду, спарклайн и прогресс к цели
  • Widget — Контейнер дашборда: заголовок, действия, крупное число, легенда и область графика
  • Number Value — Число с учётом локали: валюта, проценты, компактная запись и единицы
  • Trend Value — Изменение показателя: стрелка, знак и цвет, текстом или пилюлей
  • Proportion Bar — Полоса долей с легендой: хранилище, бюджет, структура
  • Activity Rings — Концентрические кольца прогресса к целям
  • Leaderboard — Рейтинг: места с медалями, миниатюры, цифры и динамика за период
  • Data Table — Таблицы с поиском и сортировкой
  • Data Grid — Таблица на 100 000 строк: группировка, фильтры, редактирование
  • Virtual List — Виртуальный список на 100 000 строк
  • Bulk Action Bar — Панель действий над выбранными строками с горячими клавишами

Назад: KPI Group · Далее: Widget · Весь раздел «Данные и показатели»