Flow
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.
ExperienceFlow
import { ExperienceFlow } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
flow | UseExperienceReturn | Required | — |
animation | AnimationSettings | undefined | — | Directional animate.css settings (page_animation_type / page_animation_speed). When set, the page transition uses per-direction enter/leave classes resolved from the navigation direction + the leaving page's vars.animate_next/_prev. When absent, the renderer falls back to the named transitionName (a fade). |
transitionName | string | undefined | "experience-fade" | CSS transition name used when animation is not provided. |
headerKey | string | undefined | — | Identity of the current page's header chrome (e.g. logo|background). The #header slot is shown when this is truthy and re-keyed by it, so the header region transitions (in lockstep with the page, same direction) only when it toggles or its content changes — and persists when unchanged. |
footerKey | string | undefined | — | Same as headerKey, for the #footer slot. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
content-after-leave | [] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
header | {} | — | — |
footer | {} | — | — |
loading | {} | — | — |
error | { error: Error; retry: () => Promise<void>; dismiss: () => void; } | — | — |
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.
BasicFlow
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import ExperienceFlow from './ExperienceFlow.vue'
import { useExperience } from './useExperience'
import { WelcomePage } from './pages/welcome'
import { TermsPage } from './pages/terms'
import { InstructionsPage } from './pages/instructions'
import { FinalPage } from './pages/final'
{
name: 'Welcome → Terms → Instructions → Final',
render: () => ({
components: { ExperienceFlow },
setup() {
const flow = useExperience({
pages: [
{ name: 'welcome', component: WelcomePage, props: {
title: 'GXP Experience Demo',
subtitle: 'A four-step demo of the experience flow.',
ctaText: 'Begin',
} },
{ name: 'terms', component: TermsPage, props: {
title: 'Quick consent',
html: TERMS_HTML,
} },
{ name: 'instructions', component: InstructionsPage, props: {
title: 'How it works',
html: '<p>Click <strong>Continue</strong> to finish.</p>',
} },
{ name: 'final', component: FinalPage, props: {
title: '🎉 You made it!',
showRestart: true,
actions: [{ key: 'share', label: 'Share', variant: 'primary' }],
} },
],
onComplete: () => alert('Flow complete'),
})
return { flow }
},
template: '<div class="h-screen w-screen bg-background"><ExperienceFlow :flow="flow" /></div>',
}),
}
WithSkipCondition
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import ExperienceFlow from './ExperienceFlow.vue'
import { useExperience } from './useExperience'
import { WelcomePage } from './pages/welcome'
import { TermsPage } from './pages/terms'
import { InstructionsPage } from './pages/instructions'
import { FinalPage } from './pages/final'
{
name: 'Skip page via when()',
render: () => ({
components: { ExperienceFlow },
setup() {
const flow = useExperience({
initialContext: { skipTerms: true },
pages: [
{ name: 'welcome', component: WelcomePage, props: { title: 'Hello' } },
{
name: 'terms',
component: TermsPage,
when: (ctx) => !ctx.skipTerms,
props: { html: TERMS_HTML },
},
{ name: 'final', component: FinalPage, props: { title: 'Done' } },
],
})
return { flow }
},
template: '<div class="h-screen w-screen bg-background"><ExperienceFlow :flow="flow" /></div>',
}),
}