A share modal widget that provides copy-link, invite-by-email, and permission-level toggling in a single dialog. Suitable for sharing documents, dashboards, projects, or any resource that supports link-based and email-based collaboration.
Introduction
Overview
Sharing resources is a universal SaaS pattern. Teams repeatedly build share dialogs with inconsistent UX for link copying, email invitations, and permission management. This widget standardizes the pattern into a reusable, accessible modal.
Goals
One-click copy-link with confirmation feedback.
Email invitation input with multiple-recipient support.
Permission-level selector (e.g., Viewer, Editor, Admin) per invite.
Display existing share recipients with their permission levels.
Ship Storybook stories covering all interaction states.
Non-Goals
Actual email delivery (consumer handles via callback).
User search or autocomplete from a directory service.
Granular per-field or per-section permissions.
Public/private link toggle with server-side enforcement.
Scope
In Scope
Item
Description
ShareModal component
Modal dialog with copy-link, invite form, and recipient list
Copy-link section
URL display with copy button and toast/inline confirmation
Invite-by-email section
Email input, permission selector, and send button
Recipient list
Shows current recipients with name, email, and permission level
Inconsistent sharing flows across different product areas
Administrators
No standard way to view and manage who has access
Definitions
Term
Definition
Share link
A URL that grants access to a resource
Permission level
The access tier granted to a recipient (e.g., Viewer, Editor)
Recipient
A user who has been granted access via email invite or link
Current State
No share modal exists in the design system. Products implement ad-hoc share dialogs using the base Dialog component, leading to inconsistent patterns for link copying, invitation, and permission management.
Proposed Solution
Create a ShareModal widget at src/components/widgets/share-modal.tsx that:
Wraps the existing Dialog component.
Displays a read-only URL field with a copy-to-clipboard button.
Provides an email input for inviting new recipients with a permission-level dropdown.
Lists current recipients with their permission levels and an option to revoke.
Calls consumer-provided callbacks for invite, permission change, and revoke actions.
Requirements
The modal must be fully controlled (open state via props), use existing Dialog primitives, and handle clipboard API gracefully with fallback.
Functional Requirements
ID
Requirement
Priority
FR-01
Display a share URL with a copy-to-clipboard button
Must
FR-02
Show inline confirmation (“Copied!”) after successful copy
Must
FR-03
Provide an email text input for entering recipient addresses
Must
FR-04
Support comma-separated multiple email entry
Must
FR-05
Include a permission-level dropdown (configurable options)
Must
FR-06
Call onInvite({ emails, permission }) on send
Must
FR-07
Display a list of current recipients with name, email, and permission
Must
FR-08
Allow permission changes on existing recipients via onChangePermission
Should
FR-09
Allow revoking access via onRevoke(recipientId)
Should
FR-10
Validate email format before allowing send
Must
Non-Functional Requirements
ID
Requirement
NFR-01
Clipboard copy works in all modern browsers; graceful fallback with execCommand