BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/moumenlab/share-permissions-popover

Share & Permissions Popover

moumenlab/share-permissions-popover
FreeComponent

A three-view floating surface that morphs on both axes with a focus trap surviving the swaps.

Live preview

live · rendered by the registry
Rendered by moumenlab on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://lab.moumen.dev/r/share-permissions-popover.json

Source

registry/lab/share-permissions-popover/share-permissions-popover.tsxlab.moumen.dev/r/share-permissions-popover.json · first 6 KB
1"use client";
2
3import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties } from "react";
4import { MotionConfig, motion, useReducedMotion } from "motion/react";
5
6// Share & permissions popover - three views in one floating element.
7//
8// A popover is a FLOATING element with three different-sized panels inside
9// (share list · a person's role picker · link settings), and swapping panels
10// has to feel like one surface changing shape, not three popovers taking turns.
11//
12// · Animated auto-size on BOTH axes. Each view declares its natural width and
13// grows its own height; views are absolutely positioned so they keep their
14// intrinsic size, and the frame's width AND height are measured px
15// (useLayoutEffect + ResizeObserver) that motion eases between - the
16// height:auto illusion, on two axes. A fresh open snaps to size instead of
17// morphing from the last session's.
18// · A focus trap that survives view swaps. Tab cycles the LIVE view's
19// controls only; every swap hands focus somewhere sensible (push → the
20// current role; pop → the row that opened it; close → the trigger). Pass
21// trap={false} to feel Tab walk out.
22// · Breadcrumb back-navigation. Escape backs out one layer at a time.
23//
24// The popover scales in FROM THE TRIGGER (origin under the Share button), stays
25// mounted so open/close are interruptible, and slides views directionally:
26// push enters from the right, pop from the left, with a short-lived leaving
27// snapshot. Animation via motion/react; honours prefers-reduced-motion.
28// Requires the lab-theme tokens. Fully Tailwind, no CSS files.
29
30const EASE = [0.22, 1, 0.36, 1] as const;
31const EASE_ICON = [0.2, 0, 0, 1] as const;
32const SLIDE = 28; // 1.75rem directional slide distance
33
34export interface Person {
35 id: string;
36 name: string;
37 email: string;
38}
39
40export interface SharePopoverState {
41 open: boolean;
42 view: string;
43 people: number;
44 link: string;
45 size: { w: number; h: number } | null;
46 lastAction: string | null;
47}
48
49type View = { name: "share" } | { name: "role"; person: Person } | { name: "link" };
50
51const ROLES = [
52 { id: "full", label: "Full access", hint: "Edit, share and manage" },
53 { id: "edit", label: "Can edit", hint: "Edit but not share" },
54 { id: "comment", label: "Can comment", hint: "Read and comment" },
55 { id: "view", label: "Can view", hint: "Read only" },
56];
57
58const LINK_SCOPES = [
59// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • https://lab.moumen.dev/r/lab-theme.json

Files it writes

  • registry/lab/share-permissions-popover/share-permissions-popover.tsx

Facts

Registry
moumenlab
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-11
Last confirmed
today

Go to the source

Docs on moumenlab lab.moumen.dev moumen-soliman/lab on GitHub Raw registry item This item as JSON

More from moumenlab

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Caret-Anchored Mention Popovercaret-mention-popovermoumenlabComponentsFree1 dep
Command Palette with Argument Chipscommand-palettemoumenlabComponentsFree1 dep
Drag-to-Reorder Listdrag-to-reorder-listmoumenlabComponentsFree1 dep
File Upload Staging Areafile-upload-stagingmoumenlabComponentsFree1 dep
Hover-Expand Icon Striphover-expand-icon-stripmoumenlabComponentsFree1 dep
Inertial Wheel Listinertial-wheel-listmoumenlabComponentsFree1 dep
Morphing Checkout Flowmorphing-checkoutmoumenlabComponentsFree1 dep
OTP Segmented Inputotp-segmented-inputmoumenlabComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex