# @spark-web/stack

> --- title: Stack storybookPath: page-layout-stack--default isExperimentalPackage: false ---

Latest version **5.1.1** (published 2026-04-14) · 0 weekly downloads

## Install

```sh
npm install @spark-web/stack
pnpm add @spark-web/stack
yarn add @spark-web/stack
bun add @spark-web/stack
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.1.1 |
| Published | 2026-04-14 |
| First published | 2022-04-20 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 6 |
| Unpacked size | 33.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | brighte, brighte-release-bot |

## Links

- npm: https://www.npmjs.com/package/@spark-web/stack
- Repository: https://github.com/brighte-labs/spark-web
- Homepage: https://github.com/brighte-labs/spark-web#readme
- Issues: https://github.com/brighte-labs/spark-web/issues
- npm.io page: https://npm.io/package/@spark-web/stack

## Dependencies (6)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.25.0
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.14.0
- [@spark-web/box](https://npm.io/package/@spark-web/box.md) ^6.0.1
- [@spark-web/theme](https://npm.io/package/@spark-web/theme.md) ^5.13.0
- [@spark-web/utils](https://npm.io/package/@spark-web/utils.md) ^5.1.0
- [@spark-web/divider](https://npm.io/package/@spark-web/divider.md) ^5.1.0

## Recent versions

- 5.1.1 (latest) — 2026-04-14
- 0.0.0-snapshot-release-20260827022754 (snapshot-release) — 2026-08-27
- 5.1.0-rc.0 (rc) — 2025-07-24
- 0.0.0-snapshot-release-20260409073509 — 2026-04-09
- 0.0.0-snapshot-release-20260409063015 — 2026-04-09
- 0.0.0-snapshot-release-20260409051926 — 2026-04-09
- 0.0.0-snapshot-release-20260409001813 — 2026-04-09
- 5.1.0 — 2026-01-15
- 5.0.2 — 2025-10-20
- 5.0.0 — 2025-02-10
- 5.0.0-rc.31 — 2025-02-10
- 5.0.0-rc.29 — 2025-02-06
- 5.0.0-rc.28 — 2025-02-06
- 5.0.0-rc.27 — 2025-02-05
- 5.0.0-rc.26 — 2025-02-05
- … 36 more at https://npm.io/package/@spark-web/stack/versions

## README

---
title: Stack
storybookPath: page-layout-stack--default
isExperimentalPackage: false
---

Used to distribute children vertically, with even spacing between each child.

```jsx live
<Stack gap="large">
  <Placeholder />
  <Placeholder />
  <Placeholder />
</Stack>
```

## Examples

### Gap

The spacing between children can be adjusted using the `gap` prop.

```jsx live
<Columns gap="xxlarge">
  <Stack gap="small">
    <Placeholder />
    <Placeholder />
    <Placeholder />
  </Stack>
  <Stack gap="medium">
    <Placeholder />
    <Placeholder />
    <Placeholder />
  </Stack>
  <Stack gap="large">
    <Placeholder />
    <Placeholder />
    <Placeholder />
  </Stack>
  <Stack gap="xlarge">
    <Placeholder />
    <Placeholder />
    <Placeholder />
  </Stack>
</Columns>
```

### Horizontal alignment

Items can be aligned horizontally using the `align` prop.

```jsx live
<Stack gap="medium" dividers>
  <Stack gap="small" align="left">
    <Placeholder />
    <Placeholder label="left" width={128} />
    <Placeholder />
  </Stack>
  <Stack gap="small" align="center">
    <Placeholder />
    <Placeholder label="center" width={128} />
    <Placeholder />
  </Stack>
  <Stack gap="small" align="right">
    <Placeholder />
    <Placeholder label="right" width={128} />
    <Placeholder />
  </Stack>
</Stack>
```

### Dividers

Use the `dividers` property to render a [Divider](/package/divider) between each
element in the Stack.

```jsx live
<Stack gap="medium" dividers>
  <Text>First item</Text>
  <Text>Second item</Text>
  <Text>Third item</Text>
</Stack>
```

### Nesting

Nest Stack components to create more complex white space rules.

```jsx live
<Stack gap="xlarge">
  <Heading level="4">Heading</Heading>
  <Stack gap="small">
    <Text>Line 1</Text>
    <Text>Line 2</Text>
    <Text>Line 3</Text>
  </Stack>
  <Stack gap="small">
    <Text>Line 1</Text>
    <Text>Line 2</Text>
    <Text>Line 3</Text>
  </Stack>
</Stack>
```

## Props

<PropsTable displayName="Stack" />

`Stack` props also include [`Box`](/package/box) props and are not listed here
(excludes `display`, `className`, `alignItems`, `flexDirection`,
`justifyContent` and `flexWrap`).

Extra props are also passed into the underlying [`Box`](/package/box) component.

[align]:
  https://github.com/brighte-labs/spark-web/blob/e7f6f4285b4cfd876312cc89fbdd094039aa239a/packages/stack/src/Stack.tsx#L24
[data-attribute-map]:
  https://github.com/brighte-labs/spark-web/blob/e7f6f4285b4cfd876312cc89fbdd094039aa239a/packages/utils/src/internal/buildDataAttributes.ts#L1

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