Engram

Cost chip

atom

A currency/cost token: an amount + its currency icon. Used for vendor costs, build/material requirements, and rewards.

Install

npx shadcn@latest add @engram/cost-chip

Registry item: /r/cost-chip.json — the machine-readable definition agents install from.

Example

184,320Glimmer4,210Bright Dust12Ascendant Shards3

Props

PropTypeDefaultDescription
sizenumber16Icon size in px.
classNamestring
iconImageRefCurrency or item icon.
amount*numberQuantity.
namestringCurrency / item name (accessibility + tooltip).
affordablebooleantrueWhether the player can afford it — dims/flags when false.

Composition

pulled in on install

Dependencies

npm
@engram/core

Own the code: shadcn add copies this component's source into your repo to read and edit directly. Extend without forking — edit the source, use asChild to swap the element, or pass the typed annotations prop for curated data.