@blockly/toolbox-search
A Blockly plugin that adds a toolbox category for searching blocks. The category displays a search field in the toolbox, and filters the available blocks as you type. The Blockly docs have more information about toolbox definitions and categories.
Installation
Yarn
yarn add @blockly/toolbox-search
npm
npm install @blockly/toolbox-search --save
Usage
import * as Blockly from 'blockly';
import '@blockly/toolbox-search';
const toolboxCategories = {
'contents': [
/* Other toolbox categories with blocks go here */
{
'kind': 'search',
'name': 'Search',
'contents': [],
}
]
};
// Inject Blockly.
const workspace = Blockly.inject('blocklyDiv', {
toolbox: toolboxCategories,
});
License
Apache 2.0