# @wordpress/data-controls

> A set of common controls for the @wordpress/data api.

Latest version **4.55.0** (published 2026-09-10) · GPL-2.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @wordpress/data-controls
pnpm add @wordpress/data-controls
yarn add @wordpress/data-controls
bun add @wordpress/data-controls
```

## Health

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

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.55.0 |
| Published | 2026-09-10 |
| First published | 2019-06-12 |
| Weekly downloads | 0 |
| License | GPL-2.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.12.0 |
| Dependencies | 3 |
| Unpacked size | 70.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11751 |
| Author | The WordPress Contributors |
| Maintainers | garypendergast, adamsilverstein, gziolo, ntwb, riad, noisysocks, kadamwhite, gutenbergplugin, jorgefilipecosta, ellatrix, iandunn206, whyisjake, ockham, sirreal, nosolosw, wpisabel, ntsekouras, nerrad, desrosj, talldanwp, peterwilsoncc, ryanwelcher, mamaduka, aduth, johnbillion |
| Keywords | wordpress, gutenberg, data, controls |

## Links

- npm: https://www.npmjs.com/package/@wordpress/data-controls
- Repository: https://github.com/WordPress/gutenberg
- Homepage: https://github.com/WordPress/gutenberg/tree/HEAD/packages/data-controls/README.md
- Issues: https://github.com/WordPress/gutenberg/issues
- npm.io page: https://npm.io/package/@wordpress/data-controls

## Dependencies (3)

- [@wordpress/data](https://npm.io/package/@wordpress/data.md) ^10.55.0
- [@wordpress/api-fetch](https://npm.io/package/@wordpress/api-fetch.md) ^7.55.0
- [@wordpress/deprecated](https://npm.io/package/@wordpress/deprecated.md) ^4.55.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 4.55.0 (latest) — 2026-09-10
- 4.54.1-next.v.202609031004.0 (next) — 2026-09-03
- 4.40.1 (wp-7.0) — 2026-06-30
- 4.33.1 (wp-6.9) — 2025-10-28
- 4.19.2 (wp-6.8) — 2025-07-08
- 4.8.4 (wp-6.7) — 2025-02-04
- 4.0.2 (wp-6.6) — 2024-06-18
- 2.6.2 (wp-6.0) — 2024-04-10
- 3.20.1 (wp-6.5) — 2024-02-20
- 3.11.13 (wp-6.4) — 2023-11-13
- 3.4.6 (wp-6.3) — 2023-10-12
- 2.26.4 (wp-6.2) — 2023-10-12
- 2.17.3 (wp-6.1) — 2022-10-04
- 2.2.9 (patch) — 2022-03-10
- 2.1.7 (wp-5.8) — 2022-03-10
- … 277 more at https://npm.io/package/@wordpress/data-controls/versions

## README

# Data Controls

The data controls module is a module intended to simplify implementation of common controls used with the [`@wordpress/data`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/data/README.md) package.

**Note:** It is assumed that the registry being used has the controls plugin enabled on it (see [more details on controls here](https://github.com/WordPress/gutenberg/tree/HEAD/packages/data#controls))

## Installation

Install the module

```bash
npm install @wordpress/data-controls --save
```

_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

The following controls are available on the object returned by the module:

## API

<!-- START TOKEN(Autogenerated API docs) -->

### apiFetch

Dispatches a control action for triggering an api fetch call.

_Usage_

```js
import { apiFetch } from '@wordpress/data-controls';

// Action generator using apiFetch
export function* myAction() {
	const path = '/v2/my-api/items';
	const items = yield apiFetch( { path } );
	// do something with the items.
}
```

_Parameters_

-   _request_ `Object`: Arguments for the fetch request.

_Returns_

-   `Object`: The control descriptor.

### controls

The default export is what you use to register the controls with your custom store.

_Usage_

```js
import { controls } from '@wordpress/data-controls';
import { registerStore } from '@wordpress/data';
import reducer from './reducer';
import * as selectors from './selectors';
import * as actions from './actions';
import * as resolvers from './resolvers';

registerStore( 'my-custom-store', {
	reducer,
	controls,
	actions,
	selectors,
	resolvers,
} );
```

_Returns_

-   `Object`: An object for registering the default controls with the store.

### dispatch

Control for dispatching an action in a registered data store. Alias for the `dispatch` control in the `@wordpress/data` package.

_Parameters_

-   _storeNameOrDescriptor_ `string | StoreDescriptor`: The store object or identifier.
-   _actionName_ `string`: The action name.
-   _args_ `any[]`: Arguments passed without change to the `@wordpress/data` control.

### select

Control for resolving a selector in a registered data store. Alias for the `resolveSelect` built-in control in the `@wordpress/data` package.

_Parameters_

-   _storeNameOrDescriptor_ `string | StoreDescriptor`: The store object or identifier.
-   _selectorName_ `string`: The selector name.
-   _args_ `any[]`: Arguments passed without change to the `@wordpress/data` control.

### syncSelect

Control for calling a selector in a registered data store. Alias for the `select` built-in control in the `@wordpress/data` package.

_Parameters_

-   _storeNameOrDescriptor_ `string | StoreDescriptor`: The store object or identifier.
-   _selectorName_ `string`: The selector name.
-   _args_ `any[]`: Arguments passed without change to the `@wordpress/data` control.

<!-- END TOKEN(Autogenerated API docs) -->

## Contributing to this package

This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.

To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).

<br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>

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