# @blockly/field-grid-dropdown

> A Blockly dropdown field with grid layout.

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

## Install

```sh
npm install @blockly/field-grid-dropdown
pnpm add @blockly/field-grid-dropdown
yarn add @blockly/field-grid-dropdown
bun add @blockly/field-grid-dropdown
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 13.3.0 |
| Published | 2026-09-10 |
| First published | 2020-12-18 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 101.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13564 |
| Author | Blockly Team |
| Maintainers | gonfunko, greg-rpf, raspberry-pi, lizschwab, maribethb |
| Keywords | blockly, blockly-plugin, blockly-field, grid-dropdown |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 13.3.0 (latest) — 2026-09-10
- 13.2.2-beta.2 (beta) — 2026-08-11
- 13.2.2-beta.0 — 2026-08-11
- 13.2.0 — 2026-07-28
- 13.1.0 — 2026-06-30
- 6.0.10 — 2026-04-09
- 6.0.9 — 2026-01-15
- 6.0.8 — 2026-01-05
- 6.0.6 — 2025-12-19
- 6.0.5 — 2025-12-19
- 6.0.4 — 2025-10-02
- 6.0.3 — 2025-07-17
- 6.0.2 — 2025-07-03
- 6.0.1 — 2025-05-22
- 6.0.0 — 2025-05-16
- … 93 more at https://npm.io/package/@blockly/field-grid-dropdown/versions

## README

# @blockly/field-grid-dropdown [![Built on Blockly](https://tinyurl.com/built-on-blockly)](https://github.com/google/blockly)

A [Blockly](https://www.npmjs.com/package/blockly) dropdown field with grid layout.

![](https://github.com/RaspberryPiFoundation/blockly/raw/main/packages/plugins/field-grid-dropdown/readme-media/dropdown.png)

![](https://github.com/RaspberryPiFoundation/blockly/raw/main/packages/plugins/field-grid-dropdown/readme-media/dropdown-images.png)

## Installation

### Yarn

```
yarn add @blockly/field-grid-dropdown
```

### npm

```
npm install @blockly/field-grid-dropdown --save
```

## Usage

This field accepts the same parameters as the [Blockly.FieldDropdown](https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/dropdown/#creation)
in Blockly core. The config object bag passed into this field accepts additional optional parameters:

- `"columns"` to specify the number of columns in the dropdown field (must be an integer greater than 0).
  If not provided, the default is 3 columns.
- `"primaryColour"` to specify the colour of the dropdown (must be a string CSS colour). If not provided,
  the dropdown color will match the primary colour of the parent block.
- `"borderColour"` to specify the colour of the border of the dropdown (must be a string CSS colour). If
  not provided, the border colour will match the tertiary colour of the parent block.

### JavaScript

```js
import * as Blockly from 'blockly';
import {FieldGridDropdown} from '@blockly/field-grid-dropdown';
Blockly.Blocks['test_field_grid_dropdown'] = {
  init: function () {
    this.appendDummyInput()
      .appendField('grid dropdown: ')
      .appendField(
        new FieldGridDropdown([
          ['A', 'A'],
          ['B', 'B'],
          ['C', 'C'],
          ['D', 'D'],
          ['E', 'E'],
          ['F', 'F'],
          ['G', 'G'],
          ['H', 'H'],
        ]),
        'FIELDNAME',
      );
  },
};
```

### JSON

```js
import * as Blockly from 'blockly';
import '@blockly/field-grid-dropdown';
Blockly.defineBlocksWithJsonArray([
  {
    type: 'test_field_grid_dropdown',
    message0: 'template: %1',
    args0: [
      {
        type: 'field_grid_dropdown',
        name: 'FIELDNAME',
        options: [
          ['A', 'A'],
          ['B', 'B'],
          ['C', 'C'],
          ['D', 'D'],
          ['E', 'E'],
          ['F', 'F'],
          ['G', 'G'],
          ['H', 'H'],
        ],
      },
    ],
  },
]);
```

## License

Apache 2.0

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