Skip to main content
Version: v1 (Current)

Share

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

SharePage​

import { SharePage } from '@gxp-dev/app-ui'

Repository source

Flow defaults: action None, result key page name (when data/result is produced).

Props​

NameTypeRequired / defaultDescription
classstring | undefinedundefined—
showBackboolean | undefinedtrueShow the secondary Back button (flow use); off for a standalone share view.
titlestring | undefined'Share'—
contextRecord<string, unknown> | undefined{}Reactive context — used to read media from prior steps when prop is null.
watermarkUrlstring | undefinedundefinedOptional client-side watermark/overlay image drawn over image & video media. Use when the backend's pre-composited variant isn't ready yet; clear it once the server-side overlay lands so it isn't doubled up.
watermarkOpacitystring | number | undefined0.45Opacity for the watermark overlay (0–1).
mediaSharePageMedia | null | undefinednull—
attributionShareAttribution | null | undefinednull—
shareLabelstring | undefined'Share'—
doneLabelstring | undefined'Done'—
shareTextstring | undefinedundefinedText passed to navigator.share (and fallback).
cardboolean | undefinedfalseGroup the attribution, media, and caption into a single contained "card" (rounded, bordered, constrained width) instead of the default full-width stacked layout.
messagestring | undefinedundefinedInstruction line shown above the media (e.g. "Tap and hold to save"). HTML.
showDoneboolean | undefinedtrueShow the secondary Done button (flow use); off for a standalone share view.

Events​

NameTypeRequired / defaultDescription
back[]——
next[]——
exit[]——
shared[success: boolean]——

Slots​

NameTypeRequired / defaultDescription
header{ attribution: ShareAttribution | null; }——
media{ media: SharePageMedia | null; }——
actions{ share: () => Promise<void>; done: () => void; back: () => void; }——
fallback{ visible: boolean; dismiss: () => boolean; }——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import SharePageComponent from './SharePage.vue'
{
args: {
title: 'Your photo',
attribution: { name: 'Steve', avatarUrl: 'https://placehold.co/64x64/9333ea/ffffff?text=S' },
media: {
type: 'image',
url: 'https://placehold.co/800x800/0ea5e9/ffffff?text=Shared',
caption: 'Look what I made!',
},
},
render: (args) => ({
components: { SharePage: SharePageComponent },
setup: () => ({ args }),
template: '<div class="h-screen w-screen"><SharePage v-bind="args" /></div>',
}),
}

CardWithWatermark​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import SharePageComponent from './SharePage.vue'
{
args: {
title: 'Your photo',
card: true,
attribution: { name: 'Steve Rogers', avatarUrl: 'https://placehold.co/64x64/9333ea/ffffff?text=S' },
watermarkUrl: 'https://placehold.co/800x800/000000/ffffff?text=%20%C2%A9%20EVENT%20',
watermarkOpacity: 0.35,
},
// `media` is bound outside `args` to avoid Vue's prop/slot name-collision type
// on the StoryObj args object (the `media` prop and `media` slot share a name).
render: (args) => ({
components: { SharePage: SharePageComponent },
setup: () => ({
args,
media: {
type: 'image',
url: 'https://placehold.co/800x800/0ea5e9/ffffff?text=Shared',
caption: 'Look what I made!',
},
}),
template:
'<div class="h-screen w-screen bg-neutral-900"><SharePage v-bind="args" :media="media" /></div>',
}),
}
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import SharePageComponent from './SharePage.vue'
{
args: {
title: 'Your photo',
message: 'Tap and hold the image to save it to your device.',
card: true,
showBack: false,
showDone: false,
attribution: { name: 'Steve Rogers', avatarUrl: 'https://placehold.co/64x64/9333ea/ffffff?text=S' },
},
render: (args) => ({
components: { SharePage: SharePageComponent },
setup: () => ({
args,
media: {
type: 'image',
url: 'https://placehold.co/800x800/0ea5e9/ffffff?text=Shared',
caption: 'Look what I made!',
},
}),
template:
'<div class="h-screen w-screen bg-neutral-900"><SharePage v-bind="args" :media="media" /></div>',
}),
}