---
title: "Section Stack"
description: "Full-view sections that pin one after another. Each next section slides up over the one before it, which shrinks, rounds its corners, and dims."
url: https://gelatinui.com/components/section-stack
markdown_url: https://gelatinui.com/components/section-stack.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/section-stack"
version: "2026-11-10"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Section Stack

> Full-view sections that pin one after another. Each next section slides up over the one before it, which shrinks, rounds its corners, and dims.

Page: https://gelatinui.com/components/section-stack

## When to use it

Best for: A few full-view sections (two to six) that slide over each other like a stack of sheets.

- Put each section in a `SectionStackItem`. It has the page color; set another background with `className`.
- Keep each section to one view: the item clips content that is taller.
- Set the shrink of a covered section with `shrink`, and its corner with `--section-stack-corner` (24px) on the root.
- In a scroll box, pass the box as `container` and set `--parallax-view` to its height.

## When not to use it

- For slides that a reader swipes through side by side, use [Carousel](https://gelatinui.com/components/carousel.md).
- For one photo that moves a little slower than the page, use [Parallax Image](https://gelatinui.com/components/parallax-image.md).

## Notes for agents

- The root is a `Parallax` with `range="pin"`; each item is a sticky stage one view tall, so the root pins for (n − 1) views.
- Each item finds its index and the count from the DOM, so items map from data with no index prop, and adds and removes are followed.
- A covered item moves `scale`, `clip-path`, and the dim `opacity` only; `dim={false}` turns the dim off.
- A keyboard focus in a section that is not in place scrolls the page to its place (page scroll only, not in a `container`).
- `disabled` makes plain sections in the flow, at least one view tall, with no pin and no scroll work.
- Under a sticky header, set `--parallax-pin-top` on a parent to the header height.

## Anatomy

```text
SectionStack
└─ SectionStackItem (0..n)
```

## API reference

### SectionStack

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `container` | `RefObject<HTMLElement \| null>` |  | The scroll box, when the item scrolls inside one and not with the page. |
| `shrink` | `number` | 0.08 | How much smaller an item gets when the next one covers it: 0.08 is 8%. Default 0.08. |
| `dim` | `boolean` | true | An item dims as the next one covers it. Default true. |
| `disabled` | `boolean` | false | Plain sections in the flow: no pin, no shrink, no dim, and no scroll work. |

### SectionStackItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  |  |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| SectionStack | `section-stack` |  | `--section-stack-corner` |  |
| SectionStackItem | `section-stack-shade` |  | `--parallax-pin-top`, `--parallax-view`, `--section-stack-corner` |  |

## Usage

Put one full-view section in each item.

The sample also uses `image`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui-pro/section-stack @gelatin-ui/image
```

```tsx title="lakes-guide.tsx"
import { SectionStack, SectionStackItem } from "@/components/pro/effects/section-stack";
import { Image } from "@/components/ui/image";

const lakes = [
  { src: "/lake-braies.webp", alt: "A boat on a turquoise lake" },
  { src: "/plitvice.webp", alt: "A bridge beside a waterfall" },
];

export function LakesGuide() {
  return (
    <SectionStack>
      {lakes.map((lake) => (
        <SectionStackItem key={lake.src}>
          <Image src={lake.src} alt={lake.alt} fill />
        </SectionStackItem>
      ))}
    </SectionStack>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/section-stack
```

It adds 24 registry items: 23 files, 3773 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Parallax](https://gelatinui.com/components/parallax.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Parallax](https://gelatinui.com/components/parallax.md)
- [Parallax Image](https://gelatinui.com/components/parallax-image.md)
- [Image](https://gelatinui.com/components/image.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | A focus in a section that is not in place scrolls the page to that section. |

## Accessibility

The sections keep their reading order. The dim layer is `aria-hidden` and takes no clicks.

## Motion

| Part | Motion |
| --- | --- |
| Scroll | none · the slide, the shrink, the corner, and the dim follow the scroll in the same frame, with no easing |
