share-01
A Share dialog that invites people and teams at one level, shows who has access and why, sets general access, and offers a public link.
Last updated
What it is
The Share surface for one record, page or meeting. Every row, level and link comes in through
props and every change goes out through a callback, so the same dialog serves tasks, meetings and
pages. It is a Dialog (size default) from the 768px mobile breakpoint up and a bottom Sheet
below it, with the same sections in both. It is a block: you pull it once with shadcn add,
and then you own it. ShareDemo wires it to sample state.
Install
npx shadcn@latest add @vegastack/share-01This installs the block's own files plus the components it composes: button, checkbox,
copy-button, dialog, input-group, people-input, permission-menu, person-avatar,
select, sheet, skeleton, space-avatar, textarea, tooltip, use-mobile.
Preview
Invite mode
Once a chip is chosen the dialog switches to the invite: one access level for the whole batch
(PermissionMenu), Notify people (on by default), an optional message, and Cancel / Share.
onInvite receives { invitees, level, notify, message }, and the chips clear when it resolves.
Public link on
"Copy public link" turns the link on (onCreatePublicLink; return the URL and it is copied). While
it is on: the URL with Copy and a Reset button (its tooltip says the current link stops working),
an Expires select (Never, 1 day, 7 days, 30 days) and Stop sharing.
Read-only viewer
canManage={false}: no invite row, every level as text, general access as text, and the public
link to copy (or "Off").
Anatomy
- Invite row:
PeopleInputwith the host'ssearch. - Invite mode:
Checkbox"Notify people",PermissionMenufor the batch,Textarea, footer Cancel / Share (loadingwhileonInviteruns). - People with access:
PersonAvatar(people and teams), the name with "(you)", a muted reason ("Creator", "Assignee", "Manager of Priya", "via Sales team"), andPermissionMenu(readOnlyfor built-in rows, Remove access withonRemove).loadingshows skeleton rows. - General access:
SpaceAvatar, a ghostSelect("Everyone in ‹space›" / "Only people invited") with a muted hint, and the space's level. - Anyone with the link: off — "Off" and "Copy public link"; on —
InputGroupwith the URL,CopyButtonand a Reset button in aTooltip, an ExpiresSelect, and "Stop sharing".publicLinkPendingholds these controls while a change runs. - Footer: the note (
footerNote, e.g. "Admins can view this space."), Copy link (linkUrl) on the left and Done on the right. Every string is inlabels.
Files
| File | Registry type | Target |
|---|---|---|
share-01/components/share-dialog.tsx | registry:component | app/share-01/components/share-dialog.tsx |
share-01/components/share-demo.tsx | registry:component | app/share-01/components/share-demo.tsx |
share-01/page.tsx | registry:page | app/share-01/page.tsx |
Do / Don't
page-editor-01
A Notion-style document page with comments beside the text — outline rail or sheet, comment highlights, a comment margin or popover, and version history.
notifications-01
The Regent Inbox — a sheet on the Inbox component with Mark all read, a More menu, All | Unread chips, day groups, rich rows, action chips and infinite scroll.