Item Info
The details of an item: rarity, type, description, stats with +/- against the equipped one, value and action buttons. As a card, a compact tooltip or a panel.
compareTo shows green and red deltas per stat. Actions carry their own handler and keyboard hint.
Lotus hat
Woven by the best hands in the village.
- Heat resist
- +7+3
- Charm
- +3+2
Compared with your Straw hat.
180 coins
Moon gem
Glows softly on festival nights.
1200 coins
Installation
Usage
Examples
Tooltip
Wrap any trigger, usually an ItemSlot, in ItemTooltip. It opens on hover and on keyboard focus.
API
Everything else is passed through to the underlying element or Radix primitive.
| Prop | Type | Default | Description |
|---|---|---|---|
item | GameItem | – | The item to show. |
compareTo | GameItem | null | – | Shows a delta for each stat with a numeric amount; better: "lower" flips the colour. |
actions | { id, label, onSelect?, variant?, disabled?, shortcut? }[] | – | Buttons in the footer. |
variant | "card" | "compact" | "panel" | "card" | Card is 340px wide, compact suits tooltips, panel fills its container. |
formatValue | (value, item) => ReactNode | "{value} coins" | How the value prints; return null to hide it. |
renderStats / children | fn / ReactNode | – | Replace the stats list, or add lore, set bonuses or requirements under it. |