FlagProps型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a binding's flag takes: the same as <hata-flag>'s attributes. Every field but code may be left out.
インポート
import type { FlagProps } from "@johnmorrisdotca/hata/bind";
ほかのエクスポート元: @johnmorrisdotca/hata/react, @johnmorrisdotca/hata/vue
定義
interface FlagProps {
code: string;
shape?: "own" | "flag" | "4:3" | "1:1" | "round";
fit?: Fit;
size?: "small" | "medium" | "large" | number | string;
width?: number | string;
label?: string;
lang?: "en" | "ja";
border?: boolean;
shadow?: boolean;
theme?: "auto" | "light" | "dark";
date?: string | Date;
variant?: string;
which?: FlagRole;
allowRestricted?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
code | string | The flag's code, in any case: "JP", "jp-13", "CA-ON", "DE-BY". |
shape (省略可) | "flag" | "4:3" | "1:1" | "round" | "own" | undefined |
|
fit (省略可) | Fit | undefined | How it fits a frame: |
size (省略可) | string | number | undefined | Its height: |
width (省略可) | string | number | undefined | A width in pixels, with the height following the flag's proportions; overrides |
label (省略可) | string | undefined | What a screen reader says. Left out, the place's name in |
lang (省略可) | "en" | "ja" | undefined |
|
border (省略可) | boolean | undefined | A hairline round the flag, so a white flag shows on a white page. |
shadow (省略可) | boolean | undefined | A soft shadow under it. |
theme (省略可) | "auto" | "light" | "dark" | undefined |
|
date (省略可) | string | Date | undefined | The day whose flag to draw: |
variant (省略可) | string | undefined | Which of the place's flags in real use to draw, by its |
which (省略可) | FlagRole | undefined | With |
allowRestricted (省略可) | boolean | undefined | Draw a flag whose display the law restricts (Germany's of 1935 to 1945), for history and education. Without it nothing is drawn. |
例
import { preloadFlags, type FlagProps } from "@johnmorrisdotca/hata/bind";
const tokyo: FlagProps = { code: "JP-13", shape: "round", size: "medium", label: "Tokyo" };
await preloadFlags([tokyo]);この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。