# @leafygreen-ui/card

> leafyGreen UI Kit Card

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

## Install

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

## Health

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

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

Warnings: low downloads.

## Facts

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

## Links

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

## Dependencies (5)

- [@leafygreen-ui/lib](https://npm.io/package/@leafygreen-ui/lib.md) ^15.7.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

- 13.3.1 (latest) — 2026-01-21
- 10.0.1 (beta) — 2023-07-26
- 11.0.0-alpha.1 (alpha) — 2023-07-20
- 9.0.8-next.7 (next) — 2023-05-26
- 7.1.0-test.1 (test) — 2022-09-29
- 13.3.0 — 2025-12-05
- 13.2.1 — 2025-11-13
- 13.2.0 — 2025-10-31
- 13.1.2 — 2025-10-21
- 13.1.1 — 2025-10-14
- 13.1.0 — 2025-10-07
- 13.0.5 — 2025-09-10
- 13.0.4 — 2025-09-03
- 13.0.3 — 2025-07-03
- 13.0.2 — 2025-06-30
- … 70 more at https://npm.io/package/@leafygreen-ui/card/versions

## README

# Card

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

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

## Installation

### PNPM

```shell
pnpm add @leafygreen-ui/card
```

### Yarn

```shell
yarn add @leafygreen-ui/card
```

### NPM

```shell
npm install @leafygreen-ui/card
```

## Example

```tsx
import Card from '@leafygreen-ui/card';

<Card className="card-styles" as="article">
  This is my card component
</Card>;
```

## Properties

Card is a styled wrapper for the Box component. Any properties you would pass to Box can also be passed to Card.

| Prop        | Type              | Description                                                       | Default |
| ----------- | ----------------- | ----------------------------------------------------------------- | ------- |
| `children`  | `React.ReactNode` | Content rendered inside of the `<Card />` component               |         |
| `className` | `string`          | Adds a className to the class attribute                           |         |
| `darkMode`  | `boolean`         | Determines whether or not the component will appear in dark mode. | `false` |

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

## Usage and Interactivity

This component is designed to be a container for other elements and content. We discourage `onClick` or `href` directly to the Card component. Instead, we recommend adding interactive elements inside the component.

### DO ✅

```tsx
<Card>
  <Button onClick={handleOnClick} />
</Card>
```

### DON'T 🚫

```tsx
<Card onClick={handleOnClick}>This is my card component</Card>
```

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