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

Use your own part index

Keep native Radical fields and make names and stroke metadata optional.

Supply plain Radical entries

import { kanjiForRadicals, radicalGroups, type Radical } from "@johnmorrisdotca/bushu";
const parts: Radical[]=[{radical:"水",strokes:4,kanji:"海湖"},{radical:"月",strokes:4,kanji:"湖"}];
console.log(kanjiForRadicals(parts,["水","月"]),radicalGroups(parts));
[ '湖' ] [ { strokes: 4, radicals: [ '水', '月' ] } ]

This small teaching index is host data, not a replacement for the bundled dictionary’s membership claims. Each entry stores its key, part stroke count and one string of member kanji. Keep distinct keys for distinct memberships even if two display forms coincide. The lookup reads the index without mutating it.

Add a picker

Pass the same entries to mountBushu(host, {radicals:parts}). Optional name and stroke callbacks can return null for missing metadata. Use a stable index order if saved selections, teaching sheets or displayed result order must remain reproducible. Host code owns persistence and data retrieval.

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