Skip to the content

Bushu部首

Choose the parts you can see in a kanji, intersect their matches, and add a radical picker to your page.

Bushu is the Japanese word 部首 for a kanji radical. About the name

Contents

Reference · Radical picker element

BushuElementOptionstype

Host data and callbacks. Attribute choices override the host's initial selection.

Import it

import type { BushuElementOptions } from "@johnmorrisdotca/bushu/element";

Also exported from: @johnmorrisdotca/bushu/element/define

Definition

type BushuElementOptions = Partial<BushuMountOptions>;

Members

NameTypeDescription
radicals (optional)readonly Radical[] | undefined

The radicals: RADKFILE.radicals from @johnmorrisdotca/bushu/radkfile.

names (optional)((key: string) => BushuNameEntry | null) | undefined

The Japanese name and English meaning of a radical by its key, or null: radicalNameEntry from @johnmorrisdotca/bushu/names. Without it no names are shown.

strokes (optional)((kanji: string) => number | null) | undefined

The strokes in a kanji, or null: strokesOf from @johnmorrisdotca/bushu/strokes. Without it the matches are in the dictionary's order.

language (optional)BushuLanguage | undefined

The words: en or ja. Default the host's (or the page's) lang.

limit (optional)number | undefined

The most matches drawn at once; past it the picker says to choose another part. Default 120.

chosen (optional)readonly string[] | undefined

Parts already chosen, by key or by shape; any the index does not have are dropped.

kanji (optional)string | undefined

A kanji whose card is open.

onChange (optional)((detail: BushuEventDetail) => void) | undefined
onPick (optional)((detail: BushuEventDetail) => void) | undefined

Examples

import type { BushuElementOptions } from "@johnmorrisdotca/bushu/element";
const options: BushuElementOptions = {};
console.log(Object.keys(options).length); // 0
0

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/bushu 1.1.0.