# @blockly/plugin-workspace-search

> A Blockly plugin that adds workspace search support.

Latest version **13.4.0** (published 2026-10-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @blockly/plugin-workspace-search
pnpm add @blockly/plugin-workspace-search
yarn add @blockly/plugin-workspace-search
bun add @blockly/plugin-workspace-search
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score; popular repo.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 13.4.0 |
| Published | 2026-10-13 |
| First published | 2020-03-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13609 |
| Author | Blockly Team |
| Maintainers | gonfunko, greg-rpf, raspberry-pi, lizschwab, maribethb |
| Keywords | blockly, workspace, search |

## Links

- npm: https://www.npmjs.com/package/@blockly/plugin-workspace-search
- Repository: https://github.com/RaspberryPiFoundation/blockly
- Homepage: https://github.com/RaspberryPiFoundation/blockly/tree/main/packages/plugins/workspace-search#readme
- Issues: https://github.com/RaspberryPiFoundation/blockly/issues
- npm.io page: https://npm.io/package/@blockly/plugin-workspace-search

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 13.4.0 (latest) — 2026-10-13
- 13.4.1-beta.1 (beta) — 2026-11-02
- 13.3.0 — 2026-09-10
- 13.2.2-beta.2 — 2026-08-11
- 13.2.2-beta.0 — 2026-08-11
- 13.2.0 — 2026-07-28
- 13.1.0 — 2026-06-30
- 10.1.8 — 2026-04-09
- 10.1.7 — 2026-01-15
- 10.1.6 — 2026-01-05
- 10.1.4 — 2025-12-19
- 10.1.3 — 2025-12-19
- 10.1.2 — 2025-10-02
- 10.1.1 — 2025-07-17
- 10.1.0 — 2025-07-03
- … 123 more at https://npm.io/package/@blockly/plugin-workspace-search/versions

## README

# @blockly/plugin-workspace-search [![Built on Blockly](https://tinyurl.com/built-on-blockly)](https://github.com/google/blockly)

A [Blockly](https://www.npmjs.com/package/blockly) plugin that adds workspace search support.

## Installation

```
npm install @blockly/plugin-workspace-search --save
```

## Usage

### ES6 Imports

```js
import * as Blockly from 'blockly';
import {WorkspaceSearch} from '@blockly/plugin-workspace-search';

const workspace = Blockly.inject('blocklyDiv');
const workspaceSearch = new WorkspaceSearch(workspace);

workspaceSearch.init();
```

### Script Tag

```js
<script src="./node_modules/@blockly/plugin-workspace-search/dist/index.js"></script>
```

To open workspace search use either command + f or control + f. To close the search bar, press Escape or click the 'x' in the top right corner. Escape focuses the current matching block, or the workspace if there is no match.

## API

- `init`: Initializes the workspace search bar.
- `dispose`: Disposes of workspace search.
- `open`: Opens the search bar.
- `close`: Closes the search bar.
- `previous`: Selects the previous block.
- `next`: Selects the next block.
- `setSearchPlaceholder`: Sets the placeholder text for the search bar text input.
- `addActionBtn`: Add a button to the action div. This must be called after the init function has been called.
- `clearBlocks`: Clears the selection group and current block.
- `searchAndHighlight`: Searches the workspace for the current search term, highlights matching blocks, and greys non-matching blocks.

## Styling

The generated search bar looks like:

```html
<div class="ws-search'>
  <div class="ws-search-container'>
    <div class="ws-search-content'>
      <div class="ws-search-input'>
        [... text input goes here ...]
      </div>
      [... actions div goes here ...]
    </div>
    [... close button goes here ...]
  </div>
</div>
```

Here are additional CSS classes to style your search bar:

- `blockly-ws-search`: Applies to the outer-most div.
  - Default styling:
    ```css
    '.blockly-ws-search {',
      'background: white;',
      'border: solid lightgrey 0.5px;',
      'box-shadow: 0px 10px 20px grey;',
      'justify-content: center;',
      'padding: 0.25em;',
      'position: absolute;',
      'z-index: 70;',
    '}'
    ```
- `blockly-ws-search-container`: Applies to the search container.
- `blockly-ws-search-content`: Applies to the search content.
- `blockly-ws-search-input`: Applies to the input wrapper. (Default: `border: none;`)
- `blockly-ws-search-actions`: Applies to the action div.
- `blockly-ws-search-current`: Highlights the provided block as the "current selection". (Default: `filter: saturate(3) drop-shadow(0 0 8px var(--blockly-active-node-color));`)
- `blockly-ws-search-highlight`: Optionally adds highlight to the provided blocks. (Default: none.)
- `blockly-ws-search-greyed`: Applied to each non-matching block's `.blocklyPath`. (Default: `fill: lightgrey; stroke: dimgrey;`)

## License

Apache 2.0

---
_Source: https://npm.io/package/@blockly/plugin-workspace-search · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
