Reference
Native radical picker
import { … } from "@johnmorrisdotca/bushu/picker";
89.7 kB minified and gzipped, with everything it imports (measured with esbuild)
The radical picker for a page: mountBushu draws the grid of parts by stroke count and the kanji that hold the parts chosen into any
element, loadBushuData fetches the data it shows, and the words (BUSHU_STRINGS) and the style (BUSHU_STYLE) are here to read or replace.
A separate entry (@johnmorrisdotca/bushu/picker), so a server never loads any of it.
Exports
| Name | Kind | What it is |
|---|---|---|
BUSHU_RESULT_LIMIT | constant | The most matches a picker draws unless limit says. |
BUSHU_STRINGS | constant | Native English and Japanese radical-picker controls, results and accessible announcements. |
BUSHU_STYLE | constant | THE STYLE a Bushu picker wears (mountBushu, <bushu-picker>): its colours as custom properties on .bushu, its boxes, its tiles and its chips. |
BushuEventDetail | type | What a picker tells of itself, in bushu-change and bushu-pick events and to the callbacks. |
BushuLanguage | type | THE WORDS BUSHU SAYS, in English and Japanese: what the picker's buttons and lines of words say, and what a screen reader hears. |
bushuLanguageOf | function | The language a lang attribute asks for: Japanese for any ja, English for everything else. |
BushuMount | type | What mountBushu gives back: methods for everything a button does, and destroy. |
BushuMountOptions | type | The native radical data, optional names/strokes, language, result limit, initial selection and host callbacks. |
BushuNameEntry | type | The names a picker shows beside a radical: what radicalNameEntry from /names returns. |
bushuSay | function | A line in a language, with its {name} values filled in, and its One form when n is 1. |
ensureBushuStyle | function | Puts the picker's style in the page once. |
loadBushuData | function | Loads the data a picker shows, each module at the moment it is asked for, so that a page which never opens a picker never loads it: the radicals, the Japanese names and the strokes of a kanji. |
mountBushu | function | Native interface, settings and words for host code. |