API reference
App and layout
Composables for the shell: environment, navigation, sidebar, command palette, customizer and appearance.
Composables are auto-imported: call them in <script setup> without importing them.
useAppConfigEnv()
Returns the public runtime config: appName, siteUrl, apiBase and defaultCurrency from the NUXT_PUBLIC_* variables.
useAppConfigEnv()
...config.publicuseNavigation()
The menu of the app. menuItems is already filtered by the permissions of the current user; the sidebar, the horizontal menu and the command palette read it.
useNavigation(): { menuItems: any; }menuItemsuseSidebar()
Shared state of the sidebar: open on phones (openNav), rail mode (collapseNavValue), hover expansion and the active item.
useSidebar(): { collapseNav: ComputedRef<any>; collapseNavValue: any; openNav: any; activatedOption: any; collapseNavHover: any; setCollapseNavHover: (value: boolean) => void; setActivatedOptio…collapseNavcollapseNavValueopenNavactivatedOptioncollapseNavHoversetCollapseNavHoversetActivatedOptionuseCommandPalette()
Opens the command palette from anywhere with open().
useCommandPalette(): { isOpen: any; open: () => void; }isOpenopenuseCommandRecords()
search(query) returns the orders, customers and courses that match a query of two or more characters, only for the modules the current role can view. The command palette lists them under its pages and actions.
useCommandRecords(): { search: (query: string) => CommandRecord[]; }searchuseShortcutsDialog()
Opens the keyboard shortcuts sheet (AppShortcutsDialog) with open(); ? toggles it anywhere in the app.
useShortcutsDialog(): { isOpen: any; open: () => void; }isOpenopenuseGoToShortcuts()
Registers the g + letter shortcuts from GO_TO_SHORTCUTS in config/shortcuts.config.ts (g o opens orders, g s settings…). The default layout calls it once; the shortcuts sheet lists them under Go to.
useGoToShortcuts(): void
useFocusReturn()
Pass the open state of a dialog, drawer or palette opened from the keyboard: when it closes and focus would land on the page body, focus goes back to the element that opened it. The command palette, the shortcuts sheet and the landing drawer use it.
useFocusReturn(isOpen: Ref<boolean>): void
useCreateIntent()
Runs a create handler when the page opens with ?new, then removes the flag. The command palette's create actions use it, so /kanban?new opens the new card form.
useCreateIntent(create: () => void): void
useQueryParam()
Binds a view, tab or search to one query string parameter, so it survives a reload and can be shared as a link. The default value stays out of the URL, a value outside the allowed list reads as the default, and every change uses router.replace, so it adds no history entry. The module lists keep their view in ?view= and their search in ?q=; settings, team and course pages keep their tab in ?tab=.
useQueryParam(key: string, fallback: T, allowed?: readonly T[]): any
useRecordBreadcrumb()
Call it on a detail page with the record's title (a string or a getter). The breadcrumb adds the record after the list, whose crumb then links back to the list, and the document title becomes the record. The order, customer, invoice, course, student, instructor and help article pages use it.
useRecordBreadcrumb(title: MaybeRefOrGetter<string | undefined>): void
useGoBack()
goBack(fallback) returns to the previous page of the app, so a list comes back with its view, search and scroll, or navigates to fallback when there is none (the page was opened from a link, a bookmark or another site) or when the previous page was a sign-in screen. BasePageHeader uses it for its back arrow.
useGoBack(): { goBack: (fallback: RouteLocationRaw) => any; }goBackuseQuickViewOpen()
BaseQuickView calls it with its open state so the app knows how many quick views are open; useOpenQuickViews() returns that count. The table bulk bar hides while one is open, so the panel never covers it.
useQuickViewOpen(open: Ref<boolean>): void
useCustomizer()
Opens the appearance customizer with open().
useCustomizer(): { isOpen: any; open: () => void; }isOpenopenuseAppearance()
Applies the preferences to Vuetify: theme, primary palette and direction. Call it once, in app.vue.
useAppearance(): { direction: any; }directionuseThemeControl()
The light/dark toggle: current state, the icon and label to show and changeThemeMode().
useThemeControl(): { theme: ThemeInstance; isDark: any; modeIcon: any; changeThemeMode: () => void; tooltipMode: any; }themeisDarkmodeIconchangeThemeModetooltipModeuseColors()
resolveColor(name) turns a theme token into a CSS colour, for canvas or third-party libraries.
useColors(): { resolveColor: (inputColor?: string) => string; }resolveColoruseChartColors()
The chart palette from the theme: series, previous period, grid, axis labels and marker borders. Charts already use it.
useChartColors(): any
useEChart()
The lazily loaded ECharts component plus ready, which turns true once the library has loaded, so a chart can keep its skeleton until then. BaseChart, BaseSparkline and BaseMiniBars use it; register new chart types in utils/chart/echarts-setup.ts.
useEChart(): { EChart: typeof import("~/utils/chart/echarts-setup"); ready: any; }EChartreadyuseCustomIcons()
Lists the SVG icons in assets/icons/ (names) for an icon picker.
useCustomIcons(): { names: string[]; icons: { name: string; icon: `custom:${string}`; }[]; customIcon: (name: string) => CustomIconValue; }namesiconscustomIconcustomIcon()
Builds the custom: name of a custom icon.
customIcon(name: string): CustomIconValue
useMotionPresets()
Motion V presets with the shared spring: fadeIn, zoomIn, slideInY, slideInX.
useMotionPresets(): { springTransition: { readonly duration: 0.4; readonly scale: { readonly type: "spring"; readonly visualDuration: 0.4; readonly bounce: 0.15; }; readonly x: { readonly type: "spri…springTransitionfadeInzoomInslideInYslideInXusePassthroughSlots()
Forwards every slot of a wrapper component to the component it wraps, except the ones you exclude. Base components use it.
usePassthroughSlots(excluded: string[] = []): { passthroughSlots: any; }passthroughSlotsuseComboboxLabel()
Copies the aria-labelledby of the inner input to the .v-field that carries role="combobox", so screen readers announce the external label. BaseSelectInput, BaseAutocomplete and BaseCombobox call it with their field ref.
useComboboxLabel(fieldRef: Ref<unknown>): void
useSectionScrollSpy()
Tracks which section is in view and whether a navigation is sticky.
useSectionScrollSpy(items: MaybeRefOrGetter<SectionScrollSpyItem[]>, options: SectionScrollSpyOptions = {}): { isSticky: any; activeIndex: any; update: () => void; }isStickyactiveIndexupdateuseRegionName()
regionName(code) returns a country name in the current language, from Intl.DisplayNames.
useRegionName(): { regionName: (code: string) => any; }regionNameusePrintElement()
Prints one element instead of the whole page and names the PDF after it. BaseDocument's print() uses it.
usePrintElement(): { print: (target: MaybeElementRef, options?: PrintElementOptions) => void; }printuseNotifications()
The notifications of the navbar bell, shared across the app, with the unread count, markRead(id) and markAllRead(). They start from mocks/notifications.mock.ts, which is empty in the starter: load yours from your API into notifications.
useNotifications(): { notifications: any; unreadCount: any; markRead: (id: string) => void; markAllRead: () => void; }notificationsunreadCountmarkReadmarkAllRead