Paper Stack
Web (React)
A paper sleeve that fans out draggable note slips when opened.
Paper Stack holds a set of short notes behind a serif-labelled sleeve. Hover or click to open it and the slips rise out as mono-set tags that can be dragged and picked. Every surface comes from the Modus theme tokens.
Installation
CLI
npx @modus-ui/cli add paper-stackManual
- Copy the code from the component tab.
- Create a file at
components/ui/paper-stack.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | any | DEFAULT_ITEMS | Papers in the stack, as strings or item objects. |
| label | string | "Margin notes" | Folder label. |
| sublabel | string | "" | Secondary line under the label. |
| trigger | string | "hover" | Opens on "hover" or "click". |
| defaultOpen | boolean | false | Start with the folder open. |
| closeOnSelect | boolean | true | Close the folder after a paper is chosen. |
| physics | boolean | true | Let open papers sway with the pointer. |
| drift | number | 0.5 | Strength of the idle drift of the papers. |
| onSelect | any | - | Called with the chosen value and index. |
| onOpenChange | any | - | Called with the new open state. |
| folderColor | string | "hsl(var(--muted))" | Back panel colour. |
| frontColor | string | "hsl(var(--card))" | Front flap colour. |
| paperColor | string | "hsl(var(--background))" | Paper colour inside the folder. |
| itemColor | string | "hsl(var(--foreground))" | Fanned paper colour. |
| itemTextColor | string | "hsl(var(--background))" | Fanned paper text colour. |
| labelColor | string | "hsl(var(--foreground))" | Label text colour. |
| width | number | 200 | Folder width in pixels. |
| height | number | 148 | Folder height in pixels. |
| radius | number | 14 | Corner radius in pixels. |
| spread | number | 180 | Horizontal spread of the fanned papers in pixels. |
| lift | number | 26 | How far papers rise when open, in pixels. |
| tilt | number | 8 | Maximum paper rotation in degrees. |
| flapAngle | number | 34 | Front flap angle when open, in degrees. |
| restAngle | number | 16 | Front flap angle at rest, in degrees. |
| openDuration | number | 520 | Open animation duration in milliseconds. |
| stagger | number | 45 | Delay between papers in milliseconds. |
| bounce | number | 0.3 | Spring bounce of the open animation. |
Comments