# @atlaskit/width-detector

> Wrapper for components that need to respond to width changes

Latest version **7.2.0** (published 2026-08-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atlaskit/width-detector
pnpm add @atlaskit/width-detector
yarn add @atlaskit/width-detector
bun add @atlaskit/width-detector
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.2.0 |
| Published | 2026-08-29 |
| First published | 2019-02-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 64 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Atlassian Pty Ltd |
| Maintainers | atlassianartifactteam |
| Keywords | atlaskit, react, ui |

## Links

- npm: https://www.npmjs.com/package/@atlaskit/width-detector
- Repository: https://bitbucket.org/atlassian/atlassian-frontend-mirror
- Homepage: https://atlaskit.atlassian.com/packages/helpers/width-detector
- Issues: https://bitbucket.org/atlassian/atlassian-frontend-mirror/issues
- npm.io page: https://npm.io/package/@atlaskit/width-detector

## Dependencies (3)

- [raf-schd](https://npm.io/package/raf-schd.md) ^4.0.3
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [@atlaskit/react-compiler-gating](https://npm.io/package/@atlaskit/react-compiler-gating.md) ^0.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 7.2.0 (latest) — 2026-08-29
- 4.1.2 (next) — 2023-05-17
- 7.1.0 — 2026-08-20
- 7.0.0 — 2026-08-05
- 6.2.1 — 2026-08-05
- 6.2.0 — 2026-07-08
- 6.1.0 — 2026-06-26
- 6.0.1 — 2026-06-23
- 6.0.0 — 2026-06-16
- 5.1.0 — 2026-04-15
- 5.0.6 — 2026-04-08
- 5.0.5 — 2025-09-01
- 5.0.4 — 2025-08-01
- 5.0.3 — 2025-06-27
- 5.0.2 — 2025-05-02
- … 54 more at https://npm.io/package/@atlaskit/width-detector/versions

## README

# Width-detector

This package provides utilities that inform children or callbacks of the available width.

## Installation

```sh
yarn add @atlaskit/width-detector
```

## Usage

You can see [examples](https://atlaskit.atlassian.com/examples/design-system/width-detector) learn
more about the usage of this component.

### Notes

The default export `WidthDetector` is deprecated. Follow our upgrade guide and
[examples](https://atlaskit.atlassian.com/examples/design-system/width-detector) to migrate to
`WidthObserver`.

[Migration guide can be found here](./migration-guide.md).

## Acknowledgements

This size detection method used by this component is inspired by Federico Zivolo's awesome
[react-resize-aware](https://github.com/FezVrasta/react-resize-aware) project, which Atlassian has
contributed a PR back to.

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