Sharing
Share modal
The share sheet — copyable link, preview card and platform targets.
Available
Ports as-is
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Share modal
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
open* | boolean | — | Undocumented — add TSDoc to the prop in the library. |
onOpenChange* | (open: boolean) => void | — | Undocumented — add TSDoc to the prop in the library. |
shareUrl | string | "" | The URL shown in the copy field and passed to every share callback. |
title | string | "Share" | Header text. |
platforms | SocialPlatform[] | socialPlatforms | Share targets. Defaults to the seven in `./social-icons`. |
ogImageSrc | string | null | null | Initial Open Graph preview image. `null` renders the dashed upload dropzone. Changing it resets the internal preview. |
showImageActions | boolean | false | Forces the Replace / Delete overlay that normally only appears on hover, so the state is renderable as a static snapshot. |
onShare | (platform: SocialPlatform, url: string | null) => void | — | A share target was chosen. `url` is `platform.getUrl(shareUrl)` when the platform has a web-share endpoint, and `null` when it does not (Instagram, Discord, TikTok) — those are the "copy the link instead" cases. |
onCopyLink | (url: string) => void | — | The copy button was pressed. |
onImageSelect | (file: File) => void | — | A file was chosen through the upload input. |
onImageRemove | () => void | — | The delete button was pressed. |
isMobile | boolean | — | Overrides the measured viewport. `undefined` (the default) uses the live viewport; pass `true`/`false` to force the drawer or the dialog branch. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/share/ShareModal.tsx- Portability
- Copies across unchanged — only the utils import path moves.
- Notes
- Takes the share URL and OG image as props; both have prototype defaults.