Skip to main content
Version: v1 (Current)

Migrating apps to AppUI

Install the intended AppUI version, use named package imports, and import its complete stylesheet once. The current library requires Vue 3.5+, matching its VueUse dependency and the platform/DevTools runtimes.

import '@gxp-dev/app-ui/styles'
import { Button, Input, ThemeWrapper, useMedia, useExperience } from '@gxp-dev/app-ui'

Replace copied components and private source-path imports with actual exports from the public catalog. Primitive families expose companion parts; use their Storybook compositions for the correct nesting and focus behavior.

Shared media helpers​

The current media surface uses videoStream/audioStream, videoBlob/audioBlob/photoBlob, corresponding URL refs, setVideoDevice/setAudioDevice, startRecording/stopRecording, recordingError and resetState. It does not expose a generic stream/error property pair.

import { useMedia } from '@gxp-dev/app-ui'
const media = useMedia()
await media.setAudioDevice()
media.startRecording({ audio: true })
// Stop from a user action. Watch audioBlob for the result and recordingError for failures.
media.stopRecording()

Device acquisition and startRecording can throw; catch those errors in the host. recordingError reports asynchronous recorder/export failures.

State is shared within the package instance. Mounted consumers retain it until the last consumer unmounts; explicit reset invalidates late acquisition and startRecording results. Standalone callers own their reset/teardown. processUploadedVideo is a separate conversion operation; the shared-state reset does not cancel its returned promise. BarcodeScanner clones a caller-provided stream so closing the scanner does not stop its original tracks.

Experience pages​

Use useExperience/ExperienceFlow for ordered steps. Page next payloads and default result keys are listed in the generated page catalog. Bind app-owned actions explicitly and normalize the resulting data for later pages.

CameraReviewPage defaults to publishPost. Disable or replace that action when your app has a separate publishing step. LoadingPage already performs its task and defaults to a disabled flow action. Payloads for capture/review/drawing are specific to their page; use the generated contracts rather than treating all results as a bare blob.

The DevTools browser API comes from the runtime store alias. Bridge its (operationId, dependencyIdentifier, payload) method to the adapter's two-argument call signature, using declared dependencies and actual operation IDs. Adapter details.

Styling changes​

The complete style imports include utility/bridge and extracted component CSS. CSS variables contain complete color values. Hosted apps should inherit the platform palette; the explicit demo palette is optional. ThemeWrapper scopes overrides and routes library overlays into the same palette. Native scrolling/selection are the default; opt into kiosk restrictions with its kiosk prop.

DatePicker models are DateValue objects from @internationalized/date. Native FormPage date fields produce their input strings. Normalize values at your service boundary.

Image helpers are public: processUploadedImage(file) attempts JPEG conversion and preserves the original on failure; convertToCanvasBlob(file, outputType, quality) rejects conversion failures. Neither helper accepts a resize-options object.

See application recipes, flow recipes, theming, and Storybook.