調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
ツールボックスを追加する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ツールボックスには、プログラミングに使用するブロックが含まれています。ブロックはワークスペースにドラッグできます。
ツールボックスの外観について詳しくは、ビジュアル グロサリーをご覧ください。
基本的な定義
ツールボックス定義では、ツールボックスに含めるブロックとその順序を指定します。ツールボックスの外観とスタイルのほとんどは、他の方法で指定します。
ツールボックスは JSON を使用して定義することをおすすめします。
このコード スニペットは、2 つのブロックを使用して、フライアウト ツールボックスを定義します。
const toolbox = {
// There are two kinds of toolboxes. The simpler one is a flyout toolbox.
kind: 'flyoutToolbox',
// The contents is the blocks and other items that exist in your toolbox.
contents: [
{
kind: 'block',
type: 'controls_if'
},
{
kind: 'block',
type: 'controls_whileUntil'
}
// You can add more blocks to this array.
]
};
// The toolbox gets passed to the configuration options during injection.
const workspace = Blockly.inject('blocklyDiv', {toolbox: toolbox});

ツールボックスを定義して構成する方法については、ツールボックスの概要をご覧ください。
挿入の詳細については、ワークスペースの作成をご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-06-13 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-06-13 UTC。"],[[["The Blockly toolbox houses programming blocks that users can drag onto the workspace to build programs."],["Toolboxes are typically defined using JSON to specify which blocks are included and their arrangement."],["The provided code snippet demonstrates creating a basic flyout toolbox containing 'controls_if' and 'controls_whileUntil' blocks."],["Further information regarding toolbox configuration and workspace injection can be found in the linked resources."]]],["The toolbox, containing program blocks, is defined using JSON and can be dragged onto the workspace. A flyout toolbox, a simpler type, is specified by its `kind` and `contents`. The `contents` array lists blocks, defined by their `kind` and `type`, such as `controls_if` and `controls_whileUntil`. This toolbox definition is then passed to the configuration during the workspace injection process using `Blockly.inject`.\n"]]