@chessire/pieces
Version:
React chess pieces component
17 lines (16 loc) • 779 B
TypeScript
/// <reference types="react" />
import React from "react";
import { SVGAttributes } from "react";
interface PieceProps extends SVGAttributes<SVGSVGElement> {
/** Piece color */
color: "white" | "black";
/** Piece type */
piece: "K" | "Q" | "R" | "B" | "N" | "P";
/** Fill color. Defaults to "white" for white pieces and "black" for black pieces. */
fillColor?: string;
/** Contour color. Defaults to "black" for white pieces and "white" for black pieces. */
strokeColor?: string;
}
/** A chess piece. All remaining properties (notably ref, width and height) are forwarded to the SVG element. */
declare const Piece: React.ForwardRefExoticComponent<PieceProps & React.RefAttributes<SVGSVGElement>>;
export { Piece as default, Piece, PieceProps };