Strata - v1.4.10
    Preparing search index...

    Interface InventoryProps

    Props for the Inventory component.

    Renders a grid-based item container with support for dragging, tooltips, and selection.

    interface InventoryProps {
        allowDrag?: boolean;
        anchor?: UIAnchor;
        backgroundColor?: string;
        className?: string;
        columns?: number;
        onSlotClick?: (slot: InventorySlot, index: number) => void;
        onSlotDrop?: (fromIndex: number, toIndex: number) => void;
        onSlotHover?: (slot: InventorySlot | null, index: number) => void;
        rarityColors?: Record<string, string>;
        rows?: number;
        selectedIndex?: number;
        selectedSlotBorderColor?: string;
        showQuantity?: boolean;
        showTooltips?: boolean;
        slotBackgroundColor?: string;
        slotBorderColor?: string;
        slotGap?: number;
        slots?: InventorySlot[];
        slotSize?: number;
        style?: CSSProperties;
        visible?: boolean;
    }

    Hierarchy

    Index

    Properties

    allowDrag?: boolean

    Whether to allow dragging items between slots.

    anchor?: UIAnchor

    Screen corner or center to anchor the inventory container. Default: 'center'.

    backgroundColor?: string

    CSS-compatible background color for the container.

    className?: string

    Custom CSS class for the container.

    columns?: number

    Number of columns in the grid.

    onSlotClick?: (slot: InventorySlot, index: number) => void

    Callback fired when an item slot is clicked.

    onSlotDrop?: (fromIndex: number, toIndex: number) => void

    Callback fired when an item is dropped onto a new slot index.

    onSlotHover?: (slot: InventorySlot | null, index: number) => void

    Callback fired when a slot is hovered.

    rarityColors?: Record<string, string>

    Mapping of rarity names to CSS-compatible color strings.

    rows?: number

    Number of rows in the grid.

    selectedIndex?: number

    Index of the currently highlighted or active slot.

    selectedSlotBorderColor?: string

    Border color for the currently selected slot.

    showQuantity?: boolean

    Whether to display item quantities.

    showTooltips?: boolean

    Whether to show information tooltips on hover.

    slotBackgroundColor?: string

    CSS-compatible background color for each slot.

    slotBorderColor?: string

    CSS-compatible border color for each slot.

    slotGap?: number

    Gap between slots in pixels.

    slots?: InventorySlot[]

    Array of slots defining the inventory contents.

    slotSize?: number

    Pixel size of each slot.

    style?: CSSProperties

    Custom inline CSS styles for the container.

    visible?: boolean

    Toggles visibility of the inventory UI. Default: true.