Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Menambahkan toolbox
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Kotak alat berisi blok yang Anda gunakan untuk memprogram. Blok dapat
ditarik ke ruang kerja.
Untuk informasi selengkapnya tentang tampilan toolbox, lihat glosarium
visual.
Definisi dasar
Definisi toolbox menentukan blok yang disertakan dalam toolbox, dan dalam
urutan apa. Sebagian besar tampilan dan gaya kotak alat Anda ditentukan dengan cara
lain.
Sebaiknya tentukan toolbox Anda menggunakan JSON.
Cuplikan kode ini menentukan kotak alat flyout dengan dua blok:
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});

Untuk informasi selengkapnya tentang cara menentukan dan mengonfigurasi toolbox, lihat
Ringkasan toolbox.
Untuk informasi selengkapnya tentang injeksi, lihat
Pembuatan ruang kerja.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-06-13 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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"]]