Documentation
Hotbar
Vanilla 182×22 hotbar with nine 20×20 slots.
import { Hotbar } from "./index";
/**
* Hotbar 预览用例(规格 §6.1)
*/
export function HotbarDemo() {
return (
<Hotbar
items={[
{ count: 64, icon: "stone-block", tooltip: "石头 ×64" },
{ icon: "grass-block" },
{ count: 12, icon: "diamond", tooltip: "钻石 ×12" },
{ icon: "sword", tooltip: "铁剑" },
{ count: 5, icon: "apple", tooltip: "苹果 ×5" },
{},
{ icon: "experience-bottle" },
{},
{ icon: "gunpowder" },
]}
selectedIndex={2}
/>
);
}
Install
CLI copy
$npx shadcn add @tennantite/hotbarnpm install
$pnpm add @tennantite/uinpm installs the compiled package; use the CLI copy above to adapt the source.
Source
packages/ui/src/screens/hud/hotbar/index.tsxThe npm package keeps the source tree, so you can copy and adapt it directly.