← DOCS
fantasy

InventoryGrid

RPG-style inventory grid with drag-and-drop and rarity colors.

npx chaos add inventory-grid

PREVIEW

USAGE

case 'glass-button': return ; case 'neon-glow': return ; case 'floating-button': return ;
import { InventoryGrid } from '@oalacea/chaosui/navigation/inventory-grid';

const items = [
  { id: '1', icon: '⚔️', name: 'Sword', count: 1, rarity: 'legendary' },
  { id: '2', icon: '🧪', name: 'Potion', count: 5, rarity: 'common' },
];

<InventoryGrid items={items} onSelect={handleSelect} />

PROPS

PropTypeDefault
itemsInventory items {id, icon?, name?, count?, rarity?, category?}
InventoryItem[][]
gridSizeGrid dimensions
{ rows: number; cols: number }{ rows: 4, cols: 6 }
onSelectCallback when item selected
(item: InventoryItem) => void-
maxSlotsMaximum number of slots
number-