Chess Bishop
ChessBishopIcon is an animated SVG chess bishop icon built with motion/react. On hover it slides and tilts the piece, fades it out and back in, and can also be driven programmatically through a ref.


shadcn add · no workarounds · theme neutral (none shipped)Installation
Usage
import { ChessBishopIcon } from "@/components/ui/chess-bishop";export function Example() { return <ChessBishopIcon size={28} className="text-foreground" />;}- Adding a playful chess or board-game themed icon to a game, lesson, or puzzle UI
- Showing a bishop or chess-related state change with a short hover animation in navigation, menus, or buttons
- Triggering the same animation from application logic (for example on save, on a timer, or on a loading state) via the imperative ref API
- Replacing a static chess bishop glyph with an animated lucide-style icon that matches other icons in the same registry
Examples
Hover-animated icon
Default behavior: the animation plays on mouse enter and resets on mouse leave.
import { ChessBishopIcon } from "@/components/ui/chess-bishop";export function HoverExample() { return ( <div className="flex items-center gap-2 text-sm"> <ChessBishopIcon size={32} className="text-amber-600" /> <span>Hover the bishop</span> </div> );}Programmatic control via ref
Passing a ref switches the component to controlled mode: hover no longer triggers the animation, and startAnimation/stopAnimation are called manually.
"use client";import { useRef } from "react";import { ChessBishopIcon, type ChessBishopIconHandle } from "@/components/ui/chess-bishop";import { Button } from "@/components/ui/button";export function ControlledExample() { const iconRef = useRef<ChessBishopIconHandle>(null); return ( <div className="flex items-center gap-3"> <ChessBishopIcon ref={iconRef} size={28} /> <Button onClick={() => iconRef.current?.startAnimation()}>Play</Button> <Button variant="outline" onClick={() => iconRef.current?.stopAnimation()}>Reset</Button> </div> );}Inside a button
Using the icon as a leading adornment in a button; the icon sizes itself via the size prop and inherits color from the button.
import { ChessBishopIcon } from "@/components/ui/chess-bishop";import { Button } from "@/components/ui/button";export function StartGameButton() { return ( <Button className="gap-2"> <ChessBishopIcon size={18} /> Start game </Button> );}API reference
Accessibility
- The icon is decorative by default; the SVG has no role or title. If it conveys meaning, wrap it with role="img" and an aria-label on the wrapper, or place adjacent visible text.
- When the icon is the only content of an interactive control, give the control an accessible name via aria-label, since the icon contributes no text.
- The animation is purely visual and runs on hover or when startAnimation() is called; it carries no information that is not available elsewhere, so it does not need a separate announcement.
- Consider respecting prefers-reduced-motion by not calling startAnimation() or by passing a custom handler, since the built-in animation moves and rotates the piece.
- Hover-only triggering means touch and keyboard users will not see the animation; use the ref API from a focus or click handler if the motion must be exposed to them.
Docs written by anthropic:claude-haiku-5-5 from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
Use the "Chess Bishop" component (lucide-animated/chess-bishop) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/chess-bishop.json2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ChessBishopIcon } from "@/components/ui/chess-bishop";export function Example() { return <ChessBishopIcon size={28} className="text-foreground" />;}```Files & dependencies
- chess-bishop.tsx