{"name":"folder-contents","entry":"component","title":"FolderContents","description":"Folder that opens to reveal a sheet and a fan of nested folders whose documents extract independently.","category":"UI Bits","capabilities":["controls"],"needsRemotion":false,"registryDependencies":["@jbm/tokens","@jbm/scene-geometry","@jbm/folder"],"install":"npx shadcn@latest add @jbm/folder-contents","installName":"folder-contents","page":"https://jbm-ui.bns.studio/c/folder-contents","registryItem":"https://jbm-ui.bns.studio/r/folder-contents.json","sourcePath":"registry/jbm/ui/folder-contents.tsx","files":[{"source":"registry/jbm/ui/folder-contents.tsx","target":"src/jbm/ui/folder-contents.tsx","import":"@/jbm/ui/folder-contents","type":"registry:ui"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/folder-contents.md","json":"https://jbm-ui.bns.studio/catalog/folder-contents.json"},"snippet":"import { FolderContents } from \"@/jbm/ui/folder-contents\"\n\n<FolderContents\n  label=\"proyecto\"\n  open={1}\n  sheet=\"README.md\"\n  entries={[\n    { id: \"scripts\", label: \"scripts/\" },\n    { id: \"assets\", label: \"assets/\", document: \"notas.md\", documentReveal: 1 },\n  ]}\n  width={320}\n  style={{ overflow: \"visible\" }}\n/>","api":[{"export":"FolderContents","kind":"component","summary":"Fills Folder's children slot with a front sheet and nested folders, each with an optional document. Every part is a rigid object that translates into view; nothing stretches. Pure React: `open`, per-entry `reveal` and `documentReveal`, and `lift` are independent 0–1 controls with no internal timer. Other SVG props pass through to the Folder svg.","props":[{"name":"label","type":"string","required":false,"default":null,"description":"Mono label for the outer folder; also names the image for assistive technology. On the front panel (accent and ink) it follows Folder's fitLine rule (compressed to 0.8, then an ellipsis); on the tab (card tone default, or labelOn \"tab\") it is a Geist 800 tab name drawn whole."},{"name":"tone","type":"FolderTone","required":false,"default":null,"description":"Outer folder fill: vermilion accent, ink, or plain cream card."},{"name":"open","type":"number","required":false,"default":null,"description":"Outer folder opening from 0 (closed, contents hidden) to 1 (contents shown). Clamped. Defaults to 1 here, unlike Folder's 0; every reveal is multiplied by it."},{"name":"sublabel","type":"string","required":false,"default":null,"description":"Short line printed on the front panel: under the label, or near the panel top when the label is on the tab."},{"name":"labelOn","type":"\"front\" | \"tab\"","required":false,"default":null,"description":"Where the label prints while the folder is closed. Defaults to the tab for the card tone, the front panel otherwise. Once open is above 0 the sheet stands in front of the tab, so the label prints on the front panel."},{"name":"entries","type":"FolderEntry[]","required":false,"default":"[]","description":"Nested folders, back to front. Their tabs pack between y 24 and 72 of the folder space, so more entries overlap more tightly instead of growing the folder. Empty by default."},{"name":"sheet","type":"string","required":false,"default":"\"README.md\"","description":"Label printed on the front sheet (first 15 characters). An empty string removes the sheet."},{"name":"lift","type":"number","required":false,"default":"0","description":"Raises all contents together by up to 240 folder units (0–1), clipped at the folder's top, for handing the whole group out."}],"passthrough":["Omit<ComponentProps<typeof Folder>, \"children\">"]},{"export":"FolderEntry","kind":"type","summary":"One nested folder: `id` (React key), `label` (truncated after 15 characters), `reveal` 0–1 (default 1; rises from the folder bottom), optional `document` label (12 characters shown), and `documentReveal` 0–1 (default 0; lifts the document 45 units out of its folder)."}],"stage":{"mode":"declared","landscape":{"width":260,"height":220},"vertical":{"width":260,"height":220},"basis":"Renders Folder's fixed 260×220 viewBox at 260×220 stage pixels; entry count, reveals, and lift never change the box. Pass width (or style.width) to scale with height auto, and it shrinks to maxWidth 100%. The gallery uses width={320} with overflow visible so the opened sheet above the viewBox stays visible."},"examples":[{"title":"Open project folder with one extracted document","code":"import { FolderContents } from \"@/jbm/ui/folder-contents\"\n\n<FolderContents\n  label=\"proyecto\"\n  open={1}\n  sheet=\"README.md\"\n  entries={[\n    { id: \"scripts\", label: \"scripts/\" },\n    { id: \"assets\", label: \"assets/\", document: \"notas.md\", documentReveal: 1 },\n  ]}\n  width={320}\n  style={{ overflow: \"visible\" }}\n/>"}],"qa":["Drag Open folder through 0, 0.5, and 1: the sheet and nested folders slide up as rigid shapes and never cut through the front panel.","Drag Extract documents and Lift contents independently; each moves only its own objects.","Set Nested folders to 0 and 8: zero entries with an empty sheet reads as an empty folder; eight entries pack tighter without resizing the folder.","Toggle Reveal nested folders: hidden folders sit fully below the rim with complete outlines, clipped only at the container bottom.","Uncertain: at open 1 the sheet and front folders extend above the 220-unit viewBox, so they rely on overflow visible; check clipping when overflow is left hidden."],"related":[{"name":"tokens","relation":"installs"},{"name":"scene-geometry","relation":"installs"},{"name":"folder","relation":"installs"}],"family":"Folders & drawers","docs":[{"title":"Paper and filing illustrations guide","url":"https://jbm-ui.bns.studio/docs/design-video-components.md"}],"setup":{"namespace":"@jbm","componentsJson":{"registries":{"@jbm":"https://jbm-ui.bns.studio/r/{name}.json"}},"command":"npx shadcn@latest add @jbm/<name>","target":"src/jbm/","importAlias":"@/jbm/…","tsconfigPaths":{"@/*":["./src/*"]}},"rules":["Install through the @jbm namespace: each registry item JSON (/r/<name>.json) carries its files' contents and each guide is served at /docs/<slug>.md, so agents never need the source repository (it is public on GitHub for people browsing the code).","Files install to src/jbm/ and import as @/jbm/…, which needs the @/* → ./src/* path alias in tsconfig.json.","Items marked needsRemotion require the remotion package and must render inside a Remotion composition or Player; every other item works in any React page.","Use one vermilion accent per composition; accent2 is for annotations only and soft is for dark surfaces only.","Stages are 1920×1080 landscape and 1080×1920 vertical with declared safe areas; each item's stage field declares its size in stage pixels, and scenes compose from YAML-shaped specs with @jbm/scene-spec."],"links":{"catalog":"https://jbm-ui.bns.studio/catalog.json","llms":"https://jbm-ui.bns.studio/llms.txt"}}