Documentation
Crosshair
Pure CSS crosshair with an optional hidden state.
import { Crosshair } from "./index";
/**
* Crosshair 预览用例(规格 §6.1)
*/
export function CrosshairDemo() {
return (
<div className="flex items-center gap-12">
<div className="relative size-32 bg-linear-to-br from-[#5b3] to-[#357]">
<div className="absolute top-1/2 left-1/2 -translate-1/2">
<Crosshair />
</div>
</div>
<Crosshair hidden />
<Crosshair attackIndicator={0.5} />
</div>
);
}
Install
CLI copy
$npx shadcn add @tennantite/crosshairnpm install
$pnpm add @tennantite/uinpm installs the compiled package; use the CLI copy above to adapt the source.
Source
packages/ui/src/screens/hud/crosshair/index.tsxThe npm package keeps the source tree, so you can copy and adapt it directly.