Put each item in a StackItem with a key, and add a trigger to open the pile.
notifications.tsx
Stack
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| direction | "down""end""start""up" | "up" | |
| variant | "fan""stack" | "stack" | |
| peek | number | 8 | How many px of each item behind shows past the item in front of it. Default 8. |
| scale | number | 0.05 | How much smaller each item behind is: item n scales by 1 − scaleStep × n. Default 0.05. |
| max | number | 3 | The most items that show while collapsed, the front one included. Default 3. |
| gap | number | 8 | The px between two items while expanded (stack variant). Default 8. |
| fan | number | 3 | fan: the degrees each item behind turns while collapsed, to alternate sides. Default 3. |
| fan | number | 12 | fan: the degrees between two cards of the spread hand while expanded. Default 12. |
| expand | "always""click""hover" | "hover" | hover (default): expands while the pointer is over the list or focus is inside it, and on a tap on a touch screen (a tap outside collapses it). click: only a StackTrigger (or the expanded prop) expands it. always: always expanded. Escape collapses an expanded stack. |
| expanded | boolean | — | The expanded state, controlled. |
| default | boolean | false | The expanded state at the start, uncontrolled. Default false. |
| on | — | ||
| index | number | — | The child index of the front item, controlled. StackNext and StackPrevious change it. |
| default | number | 0 | The child index of the front item at the start, uncontrolled. Default 0 (the first child). |
| on | — | Gets the new front index, wrapped into 0 … count − 1. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
StackList
<ul>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <ul> attributes | — | Every other attribute goes to the <ul>, with a ref. |
StackItem
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
StackTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "sm" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "ghost" | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
StackNext
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "icon-sm" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "outline" | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
StackPrevious
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | "icon-sm" | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | "outline" | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
| Tab | Move the focus onto the pile: with hover, the pile opens. |
|---|---|
| Enter / Space | On a StackTrigger, open or close the pile. On StackNext or StackPrevious, bring another item to the front. |
| Escape | Close an open pile. |
Built with
Installs with Stack
- Components
- Button









