Modus UI

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.

Modus / Paper Stack

Installation

CLI

npx @modus-ui/cli add paper-stack

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/paper-stack.tsx.
  3. Paste the code.

Usage

tsx
import { PaperStack } from "@/components/ui/paper-stack";

export default function Example() {
  return <PaperStack />;
}

Props

PropTypeDefaultDescription
itemsanyDEFAULT_ITEMSPapers in the stack, as strings or item objects.
labelstring"Margin notes"Folder label.
sublabelstring""Secondary line under the label.
triggerstring"hover"Opens on "hover" or "click".
defaultOpenbooleanfalseStart with the folder open.
closeOnSelectbooleantrueClose the folder after a paper is chosen.
physicsbooleantrueLet open papers sway with the pointer.
driftnumber0.5Strength of the idle drift of the papers.
onSelectany-Called with the chosen value and index.
onOpenChangeany-Called with the new open state.
folderColorstring"hsl(var(--muted))"Back panel colour.
frontColorstring"hsl(var(--card))"Front flap colour.
paperColorstring"hsl(var(--background))"Paper colour inside the folder.
itemColorstring"hsl(var(--foreground))"Fanned paper colour.
itemTextColorstring"hsl(var(--background))"Fanned paper text colour.
labelColorstring"hsl(var(--foreground))"Label text colour.
widthnumber200Folder width in pixels.
heightnumber148Folder height in pixels.
radiusnumber14Corner radius in pixels.
spreadnumber180Horizontal spread of the fanned papers in pixels.
liftnumber26How far papers rise when open, in pixels.
tiltnumber8Maximum paper rotation in degrees.
flapAnglenumber34Front flap angle when open, in degrees.
restAnglenumber16Front flap angle at rest, in degrees.
openDurationnumber520Open animation duration in milliseconds.
staggernumber45Delay between papers in milliseconds.
bouncenumber0.3Spring bounce of the open animation.

Comments

  • No comments yet.