文档目录
箱子界面
176×(114+18×rows) 面板,单箱 3 行 / 大箱 6 行。
箱子
8
64
12
import { ChestScreen } from "./index";
/**
* ChestScreen 预览用例(规格 §6.2)
*/
export function ChestScreenDemo() {
return (
<ChestScreen
hotbarItems={[
{ count: 64, icon: "stone-block" },
{ icon: "grass-block" },
{ count: 12, icon: "diamond" },
]}
items={[
{ count: 27, icon: "dirt-block", tooltip: "泥土 ×27" },
{ count: 8, icon: "apple" },
{ icon: "sword" },
]}
rows={3}
selectedIndex={1}
title="箱子"
/>
);
}
安装
CLI 拷贝
$npx shadcn add @tennantite/chest-screennpm 直装
$pnpm add @tennantite/uinpm 方式安装编译产物;需要改造源码请用上方的 CLI 拷贝安装。
源码
packages/ui/src/screens/containers/chest-screen/index.tsxnpm 包保留源码目录,可直接复制改造。