ValyroUI Русская версия

Crafting Recipe

Recipe card: batches, ingredients needed and what is missing. Free, MIT · Games › Crafting

A recipe card linking the quantity you want to whole batches, the output, the surplus and every ingredient's need against the stock. A known shortage blocks crafting, unknown stock is left to the app's check in onCraft, and the success animation only starts once the app confirms.

Installation

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';

Props

PropTypeDefault
recipe *RecipeThe recipe: what one batch makes and uses.
inventoryRecord<string, number>Stock per ingredient id; an ingredient without an entry is unknown (not zero).
quantitynumberResults asked for: a positive whole number.
defaultQuantitynumber1Initial quantity when uncontrolled. Default 1.
onQuantityChange(quantity: number) => voidCalled with the new quantity when it changes.
maxQuantitynumberLargest 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.
disabledbooleanfalseLocks the quantity and the craft button.
headingLevel2 | 3 | 4 | 5 | 63Level of the result's heading. Default 3.
labelsPartial<CraftingRecipeLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

  • Tier List — S+…D tier list: portraits with role badges, role filter, drag with mouse, touch or keyboard, export
  • Meta Table — Meta table: tier, win, pick and ban rates with patch-over-patch change, role and rank filters, virtualized
  • Matchup Matrix — Counterpicks: champion-vs-champion heat matrix with tooltips, pick your champion, a list on phones
  • Tournament Bracket — Tournament bracket: single and double elimination, series scores, winner, team path, monograms
  • Patch Notes — Patch notes: champions and items with ability icons, before → after, buffs, nerfs and changes, filters

Previous: Patch Notes · Next: Toggle · All Games