Crafting Recipe
Карточка рецепта: сборки, расход ингредиентов и нехватка. Бесплатно, MIT · Игры › Крафт
Установка
npx valyro-cli@latest add crafting-recipe
npx shadcn@latest add https://valyro.xyz/r/crafting-recipe.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { CraftingRecipe } from 'valyro-ui';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
recipe * | Recipe | The recipe: what one batch makes and uses. | |
inventory | Record<string, number> | Stock per ingredient id; an ingredient without an entry is unknown (not zero). | |
quantity | number | Results asked for: a positive whole number. | |
defaultQuantity | number | 1 | Initial quantity when uncontrolled. Default 1. |
onQuantityChange | (quantity: number) => void | Called with the new quantity when it changes. | |
maxQuantity | number | Largest quantity the app allows; more shows an error instead of being clamped. | |
onCraft | (request: CraftRequest) => void | Promise<void> | Crafts: returning (or resolving) confirms it, throwing (or rejecting) refuses it. While a promise runs the button and the quantity are locked. Without it the card only computes. | |
disabled | boolean | false | Locks the quantity and the craft button. |
headingLevel | 2 | 3 | 4 | 5 | 6 | 3 | Level of the result's heading. Default 3. |
labels | Partial<CraftingRecipeLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Tier List — Тир-лист S+…D: портреты с бейджем роли, фильтр ролей, перетаскивание мышью, тачем и с клавиатуры, экспорт
- Meta Table — Таблица меты: тир, винрейт, пикрейт и банрейт с изменением за патч, фильтры роли и ранга, виртуализация
- Matchup Matrix — Контрпики: матрица «чемпион против чемпиона» с тепловой шкалой и тултипами, выбор своего чемпиона, список на телефоне
- Tournament Bracket — Турнирная сетка: single и double elimination, счёт серий, победитель, путь команды, монограммы
- Patch Notes — Патчноут: чемпионы и предметы с иконками способностей, было → стало, бафф, нерф и изменение, фильтры
Назад: Patch Notes · Далее: Toggle · Весь раздел «Игры»