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 commitfc6bfb108634735f1657e533206c3f8702ad357d; 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'
Flow defaults: action None, result key page name (when data/result is produced).
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
class | string | undefined | undefined | — |
showBack | boolean | undefined | true | Show the secondary Back button (flow use); off for a standalone share view. |
title | string | undefined | 'Share' | — |
context | Record<string, unknown> | undefined | {} | Reactive context — used to read media from prior steps when prop is null. |
watermarkUrl | string | undefined | undefined | Optional 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. |
watermarkOpacity | string | number | undefined | 0.45 | Opacity for the watermark overlay (0–1). |
media | SharePageMedia | null | undefined | null | — |
attribution | ShareAttribution | null | undefined | null | — |
shareLabel | string | undefined | 'Share' | — |
doneLabel | string | undefined | 'Done' | — |
shareText | string | undefined | undefined | Text passed to navigator.share (and fallback). |
card | boolean | undefined | false | Group the attribution, media, and caption into a single contained "card" (rounded, bordered, constrained width) instead of the default full-width stacked layout. |
message | string | undefined | undefined | Instruction line shown above the media (e.g. "Tap and hold to save"). HTML. |
showDone | boolean | undefined | true | Show the secondary Done button (flow use); off for a standalone share view. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
back | [] | — | — |
next | [] | — | — |
exit | [] | — | — |
shared | [success: boolean] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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>',
}),
}
StandaloneLink
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>',
}),
}