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

How-to

Embed a radical picker

Choose the native element, frame or host mount and preserve event boundaries.

Start with the builder

The builder previews the native picker with its initial radicals/kanji, language and size. It outputs version-pinned iframe, custom-element, module and framework formats. Display configuration belongs in the embed setup; custom radical data and host callbacks belong in the host options.

import "@johnmorrisdotca/bushu/element/define";
import { BushuPicker } from "@johnmorrisdotca/bushu/element";
const picker=new BushuPicker();
picker.setAttribute("parts","汁 田");
picker.setAttribute("lang","ja");
document.body.append(picker);
console.log(picker.tagName,picker.getAttribute("parts"));
picker.remove();

Use bushu-change and bushu-pick and the corresponding native callbacks; the full embed contract describes their detail and lifecycle. Validate a frame message’s origin and source before accepting it. The package does not persist lookup history. Import /element to register a host’s own tag, or /element/define for the standard tag; registration preserves an existing definition. The Docs links in the demo and builder follow initial and live language selection.

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