# XWUIGameInventoryGrid

A drag-and-drop inventory grid of item slots sized by `columns` x `rows` (default 4 x 6) at `slotSize` pixels each. Items from the `items` array are placed by their `slot` index and rendered with an icon, a stack-count badge when `quantity > 1`, and - when `rarityColors` is on - a border tinted by `rarity` (common through legendary). Hovering a filled slot raises a tooltip (`showTooltip`) with the escaped name, rarity label, description, and quantity; dragging a slot onto another moves or swaps the items and fires the `onItemMove(from, to)` callback. Programmatic helpers include `addItem`, `removeItem`, `moveItem`, and `getItem`.

## Basic Usage

Shows a drag-and-drop slot grid with rarity borders and hover tooltips.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: An inventory grid with draggable slots, rarity-colored borders, stack counts, and item tooltips.
```

## Full Backpack

A populated 5x4 backpack with items placed by slot index across every rarity tier, showing stack badges, rarity borders, tooltips, and a drag-swap listener.

```example
file: examples/FullBackpack.ts
html: examples/FullBackpack.html
title: Full Backpack
description: A populated 5x4 backpack spanning common-to-legendary rarities with stack counts and an onItemMove listener.
```

## Categorized

A category filter bar (All / Weapons / Consumables / Materials) that narrows the source items by type and rebuilds the grid into the first slots.

```example
file: examples/Categorized.ts
html: examples/Categorized.html
title: Categorized
description: Category buttons that filter items by type and rebuild the grid, re-packing the visible set top-down.
```

## Equipped Loadout

A compact single-row loadout strip of currently-worn gear, with one empty trinket slot filled live via the `addItem()` API.

```example
file: examples/EquippedLoadout.ts
html: examples/EquippedLoadout.html
title: Equipped Loadout
description: A 1x6 gear strip of equipped items where a button equips a legendary trinket into the open slot via addItem().
```

```api
```
