Valyro English version

Priority Budget

Распределение общего ограниченного бюджета очков. Бесплатно, MIT · Интерактивные блоки › Холсты, выделение и бюджет

Установка

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

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

Пропсы

PropTypeDefault
items *BudgetItem[]The items sharing the budget, in display (and redistribution) order.
total *numberThe shared resource: points, hours, percent.
stepnumber1Smallest change, shared by every item; values, limits and the total are its multiples. Default 1.
mode'pool' | 'redistribute''pool'pool (default): a change spends or returns the free remainder, the other items stay. redistribute: the sum is always total, the other unlocked items pay for a change evenly, leftover steps in item order.
valueRecord<string, number>Values by item id. The accepted values are shown; a change is only requested through onValueChange.
defaultValueRecord<string, number>Starting profile when uncontrolled; also what Reset returns to.
onValueChange(value: Record<string, number>, detail: BudgetChangeDetail) => voidCalled with the new value when it changes.
lockedIdsstring[]Ids of locked items: redistribution never moves them, and they cannot be changed.
defaultLockedIdsstring[][]Initial lockedIds when uncontrolled.
onLockedIdsChange(ids: string[]) => voidCalled with the new lockedIds when it changes.
formatValue(value: number) => stringFormats a value for display. Default: the number with the step's decimals.
disabledbooleanfalseTurns every control off.
labelsPartial<PriorityBudgetLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

  • Sticker Board — Свободная композиция из фотографий, наклеек и заметок: двигать и поворачивать
  • Lasso Select — Выделение группы карточек рамкой
  • Feature Hotspots — Точки на изображении: нажатие открывает пояснение к детали
  • Exploded Layers — Подготовленные слои изображения раздвигаются с подписями
  • Prediction Card — Сначала предположение читателя, затем ответ и разбор
  • Detail Dial — Выбор глубины объяснения: кратко, подробно, полный разбор
  • Version Scrubber — Просмотр подготовленных версий одним ползунком
  • Page Minimap — Мини-карта длинной страницы с видимой областью
  • Peel Sticker — Наклейка отклеивается за угол и открывает содержимое
  • Scratch Reveal — Стираемое покрытие над текстом или картинкой
  • Tear-off Ticket — Билет с корешком, который отрывается по перфорации
  • Split-Flap Board — Механическое табло: перелистываются только изменившиеся символы

Назад: Lasso Select · Далее: Gradient Mixer · Весь раздел «Интерактивные блоки»