Reference · Draw a bracket, a table or a road to the final
BoardOptionstype
What every board takes.
Import it
import type { BoardOptions } from "@johnmorrisdotca/taisen-brackets";
Definition
interface BoardOptions {
size?: BoardSizeName | {
width: number;
height: number;
};
theme?: "auto" | "light" | "dark";
flags?: DrawOptions["flags"];
flagHref?: DrawOptions["flagHref"];
flagShape?: "round" | "square";
locale?: string | Locale;
words?: Partial<Words>;
title?: string;
id?: string;
className?: string;
}
Members
| Name | Type | Description |
|---|---|---|
size (optional) | BoardSizeName | { width: number; height: number; } | undefined | One of |
theme (optional) | "auto" | "light" | "dark" | undefined |
|
flags (optional) | FlagRenderer | undefined | Draws a flag from its code, as for |
flagHref (optional) | ((code: string) => string | null | undefined) | undefined | The address of a flag as a picture to load, tried where |
flagShape (optional) | "round" | "square" | undefined |
|
locale (optional) | string | Locale | undefined | The language: |
words (optional) | Partial<Words> | undefined | |
title (optional) | string | undefined | The |
id (optional) | string | undefined | Prefix for the drawing's ids. Default: a hash of the state and the options. |
className (optional) | string | undefined |
Examples
import { rankingList, type BoardOptions } from "@johnmorrisdotca/taisen-brackets";
const board: BoardOptions = { size: "tablet", theme: "dark", flagShape: "square", locale: "fr" };
console.log(rankingList({ entries: [{ name: "A", points: 1 }] }, board).startsWith("<svg"));trueWhat it prints (run when this page was built)