# @bedrock-layout/stack

> bedrock-layout stack layout primitive

Latest version **4.0.1** (published 2026-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bedrock-layout/stack
pnpm add @bedrock-layout/stack
yarn add @bedrock-layout/stack
bun add @bedrock-layout/stack
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2026-02-04 |
| First published | 2020-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 449 |
| Author | Jarvis1010 <travis.mair@gmail.com> |
| Maintainers | jarvis1010 |
| Keywords | stack, layout, react |

## Links

- npm: https://www.npmjs.com/package/@bedrock-layout/stack
- Repository: https://github.com/Bedrock-Layouts/Bedrock
- Homepage: https://bedrock-layout.dev/
- Issues: https://github.com/Bedrock-Layouts/Bedrock/issues
- npm.io page: https://npm.io/package/@bedrock-layout/stack

## Dependencies (2)

- [@bedrock-layout/type-utils](https://npm.io/package/@bedrock-layout/type-utils.md) ^0.2.0
- [@bedrock-layout/spacing-constants](https://npm.io/package/@bedrock-layout/spacing-constants.md) ^4.0.1

## 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

- 4.0.1 (latest) — 2026-02-04
- 4.0.0 — 2026-02-03
- 3.3.4 — 2025-05-05
- 3.3.3 — 2025-02-07
- 3.3.2 — 2024-08-20
- 3.3.1 — 2024-06-03
- 3.3.0 — 2024-03-26
- 3.2.0 — 2024-03-06
- 3.1.18 — 2024-02-14
- 3.1.17 — 2024-02-14
- 3.1.16 — 2024-02-14
- 3.1.15 — 2024-01-18
- 3.1.14 — 2024-01-12
- 3.1.13 — 2023-12-03
- 3.1.12 — 2023-10-15
- … 90 more at https://npm.io/package/@bedrock-layout/stack/versions

## README

# `@bedrock-layout/stack`

A layout helper component that creates a vertical stack layout with gutters (spacing) between each item.

Full docs at: [bedrock-layout.dev](https://bedrock-layout.dev/)

---

## When to Use

The `Stack` component literally stacks its child components on top of each other, while maintaining a consistent spacing between them.

---

## How to install

`npm install @bedrock-layout/stack`

or

`yarn add @bedrock-layout/stack`

---

## Usage

```javascript
import { Stack } from "@bedrock-layout/stack";

<Stack gap="size3">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</Stack>;
```

---

## data-attribute

For styling purposes, you can select `data-br-stack`.

---

## API

\* required

| Property |                 Description                 |                   Type                    |  Default  |
| :------: | :-----------------------------------------: | :---------------------------------------: | :-------: |
|  gap\*   | Sets the space between each child component |             one of `Spacing`              |     -     |
|  align   |  Sets the inline alignment of the children  | `start` \| `end` \| `center` \| `stretch` | `stretch` |
| padding  |        Adds padding inside the Stack        |              `PaddingConfig`              |     -     |

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