# @leafygreen-ui/icon-button

> LeafyGreen UI Kit Icon Buttons

Latest version **17.1.5** (published 2026-01-21) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @leafygreen-ui/icon-button
pnpm add @leafygreen-ui/icon-button
yarn add @leafygreen-ui/icon-button
bun add @leafygreen-ui/icon-button
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 17.1.5 |
| Published | 2026-01-21 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 145.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 271 |
| Maintainers | thesonofthomp, brookescarlett, shaneeza, stephl3, _tsck |

## Links

- npm: https://www.npmjs.com/package/@leafygreen-ui/icon-button
- Repository: https://github.com/mongodb/leafygreen-ui
- Homepage: https://github.com/mongodb/leafygreen-ui/tree/main/packages/icon-button
- Issues: https://jira.mongodb.org/projects/PD/summary
- npm.io page: https://npm.io/package/@leafygreen-ui/icon-button

## Dependencies (8)

- [polished](https://npm.io/package/polished.md) ^4.2.2
- [@leafygreen-ui/lib](https://npm.io/package/@leafygreen-ui/lib.md) ^15.7.0
- [@leafygreen-ui/a11y](https://npm.io/package/@leafygreen-ui/a11y.md) ^3.0.5
- [@leafygreen-ui/icon](https://npm.io/package/@leafygreen-ui/icon.md) ^14.8.0
- [@leafygreen-ui/tokens](https://npm.io/package/@leafygreen-ui/tokens.md) ^4.2.2
- [@leafygreen-ui/emotion](https://npm.io/package/@leafygreen-ui/emotion.md) ^5.2.0
- [@leafygreen-ui/palette](https://npm.io/package/@leafygreen-ui/palette.md) ^5.0.2
- [@leafygreen-ui/polymorphic](https://npm.io/package/@leafygreen-ui/polymorphic.md) ^3.1.0

## Recent versions

- 17.1.5 (latest) — 2026-01-21
- 15.0.14 (beta) — 2023-07-26
- 16.0.0-alpha.1 (alpha) — 2023-07-20
- 15.0.11-next.7 (next) — 2023-05-26
- 13.2.0-test.0 (test) — 2022-09-22
- 17.1.4 — 2025-11-24
- 17.1.3 — 2025-11-13
- 17.1.2 — 2025-10-31
- 17.1.1 — 2025-10-21
- 17.1.0 — 2025-10-07
- 17.0.6 — 2025-09-25
- 17.0.5 — 2025-09-10
- 17.0.4 — 2025-09-03
- 17.0.3 — 2025-07-03
- 17.0.2 — 2025-06-30
- … 108 more at https://npm.io/package/@leafygreen-ui/icon-button/versions

## README

# IconButton

![npm (scoped)](https://img.shields.io/npm/v/@leafygreen-ui/icon-button.svg)

#### [View on MongoDB.design](https://www.mongodb.design/component/icon-button/live-example/)

## Installation

### PNPM

```shell
pnpm add @leafygreen-ui/icon-button
```

### Yarn

```shell
yarn add @leafygreen-ui/icon-button
```

### NPM

```shell
npm install @leafygreen-ui/icon-button
```

## Example

```js
import EllipsisIcon from '@leafygreen-ui/icon/dist/Ellipsis';
import IconButton from '@leafygreen-ui/icon-button';

<IconButton darkMode={true} aria-label="Some Menu">
  <EllipsisIcon />
</IconButton>;
```

## Properties

| Prop                              | Type                               | Description                                                                                                       | Default     |
| --------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------- |
| `darkMode`                        | `boolean`                          | Determines whether or not the IconButton will appear in darkMode.                                                 | `false`     |
| `onClick`                         | `function`                         | The event handler function for the 'onclick' event. Receives the associated `event` object as the first argument. |             |
| `disabled`                        | `boolean`                          | Disables the `<IconButton />`                                                                                     | `false`     |
| `href`                            | `string`                           | If a href is supplied, the component renders inside of an `a` tag instead of inside of a `button` tag.            |             |
| `className`                       | `string`                           | Adds a className to the class attribute on the container element.                                                 |             |
| `children`                        | `node`                             | Content rendered inside of the `<IconButton />` component                                                         |             |
| `size`                            | `'default'`, `'large'`, `'xlarge'` | Determines the size of the IconButton                                                                             | `'default'` |
| `active`                          | `boolean`                          | Determines whether the `<IconButton />` will appear `active`                                                      | `false`     |
| `aria-label` or `aria-labelledby` | `string`                           | One of these must be provided. See note below                                                                     |             |
| ...                               | native anchor or button attributes | Any other properties will be spread on the rendered HTML element or component.                                    |             |

### Special Case: Aria Labels

Either `aria-label` or `aria-labelledby` must be provided a string, or there will be a console error. This is to ensure that screenreaders have a description for what the button does, since the button itself doesn't contain any text.

_Any other properties will be spread on the container element._

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