Skip to content

The Nuxt UI package

The framework’s primary UI is a pnpm workspace in ui/ of the framework repository. It is Nuxt UI v4 on plain Vue 3 and Vite (no Nuxt, no Nitro) with strict TypeScript. These packages are shared by every application:

Package What it holds
@flowcatalyst/ui The theme (Nuxt UI tokens and variants), the Vite plugin, the Vue plugin, the Fw* parts, list and form partials, FwAppShell, composables, and the standard admin pages
@flowcatalyst/api-runtime The configured generated-client runtime, the error envelope, the browser session and its route guard, Zod’s CSP setting, the shared openapi-ts configuration, and the generated client of the framework’s own endpoints
@flowcatalyst/push The push reader (PushCore, PushStream), with no DOM. @flowcatalyst/ui depends on it, so an application links it as well as the other two; the Vue layer over it is @flowcatalyst/ui/push

Both ship as TypeScript and Vue source: the application’s Vite build compiles them. They are not published to npm; an application links them by path from a checkout of the framework.

The workspace also contains apps/gallery (a behaviour checklist of every part, tested with Playwright and axe under the strict policy) and two sample applications, apps/orders and apps/tickets, each built against a real framework backend. They are the best worked examples.

"dependencies": {
"@flowcatalyst/ui": "link:../flowcatalyst-framework/ui/packages/ui",
"@flowcatalyst/api-runtime": "link:../flowcatalyst-framework/ui/packages/api-runtime",
"@flowcatalyst/push": "link:../flowcatalyst-framework/ui/packages/push",
"@nuxt/ui": "4.11.3", "vue": "3.5.43", "vue-router": "4.6.4", "tailwindcss": "4.3.3",
"@iconify-json/lucide": "1.2.140"
}

Everything the package imports is a peer dependency. pnpm installs nothing for a link: package, and the bundler resolves the package’s imports from its real path, outside your lockfile. So the application declares @nuxt/ui, tailwindcss, vue, vue-router, zod, @vueuse/core, reka-ui and @fontsource-variable/ibm-plex-sans itself, at the versions of the workspace catalog (ui/pnpm-workspace.yaml). A missing peer is an install error. The workspace pins exact versions and refuses packages newer than seven days.

vite.config.ts
import ui from "@nuxt/ui/vite";
import { flowcatalystUi, nuxtUiOptions } from "@flowcatalyst/ui/vite";
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
const options = nuxtUiOptions(); // theme, explicit imports, bundled icons, colour mode off
export default defineConfig({ plugins: [vue(), ui(options), flowcatalystUi(options)] });
// main.ts: api-runtime FIRST, it sets Zod to jitless before any schema exists (strict CSP)
import { createApiRuntime, installSessionGuard } from "@flowcatalyst/api-runtime";
import { client } from "./api/client.gen";
const api = createApiRuntime({ clients: [client] }); // same origin, cookie only, 401 -> sign-in
installSessionGuard(router, api.session, { notPermitted: () => "/not-permitted" });
createApp(App).use(router).use(ui).use(flowcatalystUi, { api }).mount("#app");
/* the one CSS entry */
@import "tailwindcss";
@import "@nuxt/ui";
@import "@flowcatalyst/ui/theme.css";

App.vue wraps everything in UApp. The application’s tsconfig maps #build/ui and #build/ui/* to its own node_modules/.nuxt-ui/ui. flowcatalystUi() deduplicates vue, vue-router, @nuxt/ui, @vueuse/core, reka-ui and zod, so a linked package does not bring a second copy.

The flowcatalystUi Vue plugin takes two options: api (the runtime, for the session, the shell and usePermissions) and admin (the application code and operations for the standard admin pages).

The SPA is served under a policy with no 'unsafe-eval', no inline styles and no nonce. The Vite plugin exists largely to make Nuxt UI comply:

  • Nuxt UI’s runtime colour plugin writes inline <style> elements; the plugin replaces it with a real stylesheet generated at build time.
  • Libraries that inject a <style> when loaded (the drawer library under the dashboard sidebar) have their CSS lifted into a stylesheet.
  • The pre-paint colour-mode snippet is written into index.html and allowed by hash. The plugin also writes csp-hashes.json ({"scriptHashes": [...]}) beside index.html, which the server’s SPA support reads for its default policy, so no hash is copied into code.
  • Fonts are never inlined as data: URIs (IBM Plex Sans is self-hosted).
  • Zod runs in jitless mode, which is why api-runtime is imported first.

The header values come from strictContentSecurityPolicy() and strictSecurityHeaders() in @flowcatalyst/ui/csp. The serving side is described under static assets and the SPA.

The guiding rule is: use Nuxt UI’s own components, props and variants, and add a Fw* part only where FlowCatalyst behaviour is needed. The kit’s specs are a checklist of behaviours, not a visual contract for this UI.

Group Parts
Layouts and pages FwAppShell (sidebar built on UDashboardGroup, navigation filtered by permission, sign out, failure toasts, collapsible rail), FwAdminShell, FwStandalonePage, FwSignedOutPage, FwSignInFailedPage, FwUnavailablePage
Partials FwListPage (URL state, filter toolbar, drawer outlet, phone columns), FwRecordDrawer, FwFormDialog, FwFormPage
List behaviour FwTableToolbar, FwPaginator, FwCursorPager, FwRowActions, FwPickList, FwToggleGroup
Display FwStatusBadge, FwDetailList, FwDetailField, FwFormSection, FwLocalTime, FwCodeBlock, FwJsonBlock, FwCodeChips
Accessibility and mode FwAlertDialog, FwAnnouncer, FwColorModeButton

Where Nuxt UI already has the component, use it directly: UPageHeader for titles, UBadge for tags, UEmpty for empty states, UButton :loading and UProgress for busy states.

Composables: useListState (list filters, sorting and paging held in the URL, with codecs such as stringFilter and choiceFilter), useDrawerRoute, useCursorPagination, useDirtyForm, useConfirm, useFlash, useColorMode, useLocalState, useSession, usePermissions, useRequestFailureToasts, useAdminNavigation, and the optional-field adapters on the forms page.

An application’s web/ folder generates its client from its committed openapi.json (see typed operations and the OpenAPI document) with the shared settings:

web/openapi-ts.config.ts
import { fwOpenApiConfig } from "@flowcatalyst/api-runtime/openapi-ts";
export default fwOpenApiConfig({ input: "openapi.json", output: "src/api" });
"scripts": {
"api:generate": "openapi-ts",
"api:drift": "openapi-ts && git diff --exit-code -- src/api && test -z \"$(git status --porcelain -- src/api)\""
}

The generated folder is committed and CI runs api:drift, which fails on a modified or new file. Import the error envelope as ErrorEnvelope or ServiceError from @flowcatalyst/api-runtime, never the generated Error, which shadows the global.

A validated form value (Zod’s output) is not assignable to the generated request type under exactOptionalPropertyTypes. Do not cast. Pass it through exactOutput(...):

const body: IngestionBody = exactOutput(zIngestionBody.parse(form));

The shared tsconfig.base.json turns on strict, exactOptionalPropertyTypes, verbatimModuleSyntax and strictTemplates. An application extends it by package name, not by a relative path into a checkout:

web/tsconfig.app.json
{
"extends": "@flowcatalyst/ui/tsconfig.base.json",
"compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "types": ["vite/client"] },
"include": ["src/**/*.ts", "src/**/*.vue"],
"exclude": ["src/api/*/client/**", "src/api/*/core/**"],
"references": [
{ "path": "./tsconfig.generated.json" },
{ "path": "./node_modules/@flowcatalyst/api-runtime/tsconfig.generated.json" }
]
}

Two exceptions are allowed: the hey-api bundled fetch client folders (client/ and core/) are compiled without exactOptionalPropertyTypes through their own project reference, and strictTemplates lets data-* and aria-* attributes through. Because the package is consumed as source through a link, an application that imports @flowcatalyst/api-runtime should also reference that project by its real path, or the runtime’s generated client is compiled under the application’s settings and reports errors.

The workspace runs TypeScript 7 (tsc, native) for plain .ts projects and keeps TypeScript 6 for the tools that need the compiler API (vue-tsc, typescript-eslint, hey-api), through a compatibility package. Editors should keep the TypeScript 6 language server for Vue projects for now.

No any, casts or non-null assertions; exhaustive switches; no floating promises; typed props, emits and refs; no v-html; no static style attribute in a template; no PrimeVue, Pinia, axios or ofetch; none of the Nuxt UI components that break the strict policy (Banner, Splitter, the color-mode components); and localStorage or sessionStorage only inside useLocalState, tests and scripts.

From ui/ (Node 24, pnpm 10.27): pnpm install --frozen-lockfile, pnpm build, pnpm typecheck, pnpm lint, pnpm test, pnpm api:drift, pnpm licences, pnpm gallery:e2e, pnpm check (all of the above). pnpm gallery:dev serves the gallery on port 5174 without the policy.

@flowcatalyst/ui/push (also exported from @flowcatalyst/ui, and importing no Nuxt UI) gives a page one push stream through providePushHub and usePushTopics, and keeps a list or a record current with useLiveList and useLiveRecord. The reader underneath is @flowcatalyst/push. The application’s tsconfig.app.json references that package’s declarations project. See Push to clients.

  • Forms for optional fields, edit dialogs and variant forms.
  • UI kit for the theme, brand and colours.
  • Admin for the seven standard admin pages.