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.

composables/useAppConfigEnv.ts
useAppConfigEnv()
Returns...config.public

useNavigation()

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.

composables/useNavigation.ts
useNavigation(): { menuItems: any; }
ReturnsmenuItems

useSidebar()

Shared state of the sidebar: open on phones (openNav), rail mode (collapseNavValue), hover expansion and the active item.

composables/useSidebar.ts
useSidebar(): { collapseNav: ComputedRef<any>; collapseNavValue: any; openNav: any; activatedOption: any; collapseNavHover: any; setCollapseNavHover: (value: boolean) => void; setActivatedOptio…
ReturnscollapseNavcollapseNavValueopenNavactivatedOptioncollapseNavHoversetCollapseNavHoversetActivatedOption

useCommandPalette()

Opens the command palette from anywhere with open().

composables/useCommandPalette.ts
useCommandPalette(): { isOpen: any; open: () => void; }
ReturnsisOpenopen

useCommandRecords()

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.

composables/useCommandRecords.ts
useCommandRecords(): { search: (query: string) => CommandRecord[]; }
Returnssearch

useShortcutsDialog()

Opens the keyboard shortcuts sheet (AppShortcutsDialog) with open(); ? toggles it anywhere in the app.

composables/useShortcutsDialog.ts
useShortcutsDialog(): { isOpen: any; open: () => void; }
ReturnsisOpenopen

useGoToShortcuts()

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.

composables/useGoToShortcuts.ts
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.

composables/useFocusReturn.ts
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.

composables/useCreateIntent.ts
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=.

composables/useQueryParam.ts
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.

composables/useRecordBreadcrumb.ts
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.

composables/useGoBack.ts
useGoBack(): { goBack: (fallback: RouteLocationRaw) => any; }
ReturnsgoBack

useQuickViewOpen()

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.

composables/useQuickViewOpen.ts
useQuickViewOpen(open: Ref<boolean>): void

useCustomizer()

Opens the appearance customizer with open().

composables/useCustomizer.ts
useCustomizer(): { isOpen: any; open: () => void; }
ReturnsisOpenopen

useAppearance()

Applies the preferences to Vuetify: theme, primary palette and direction. Call it once, in app.vue.

composables/useAppearance.ts
useAppearance(): { direction: any; }
Returnsdirection

useThemeControl()

The light/dark toggle: current state, the icon and label to show and changeThemeMode().

composables/useThemeControl.ts
useThemeControl(): { theme: ThemeInstance; isDark: any; modeIcon: any; changeThemeMode: () => void; tooltipMode: any; }
ReturnsthemeisDarkmodeIconchangeThemeModetooltipMode

useColors()

resolveColor(name) turns a theme token into a CSS colour, for canvas or third-party libraries.

composables/useColors.ts
useColors(): { resolveColor: (inputColor?: string) => string; }
ReturnsresolveColor

useChartColors()

The chart palette from the theme: series, previous period, grid, axis labels and marker borders. Charts already use it.

composables/useChartColors.ts
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.

composables/useEChart.ts
useEChart(): { EChart: typeof import("~/utils/chart/echarts-setup"); ready: any; }
ReturnsEChartready

useCustomIcons()

Lists the SVG icons in assets/icons/ (names) for an icon picker.

composables/useCustomIcons.ts
useCustomIcons(): { names: string[]; icons: { name: string; icon: `custom:${string}`; }[]; customIcon: (name: string) => CustomIconValue; }
ReturnsnamesiconscustomIcon

customIcon()

Builds the custom: name of a custom icon.

composables/useCustomIcons.ts
customIcon(name: string): CustomIconValue

useMotionPresets()

Motion V presets with the shared spring: fadeIn, zoomIn, slideInY, slideInX.

composables/useMotionPresets.ts
useMotionPresets(): { springTransition: { readonly duration: 0.4; readonly scale: { readonly type: "spring"; readonly visualDuration: 0.4; readonly bounce: 0.15; }; readonly x: { readonly type: "spri…
ReturnsspringTransitionfadeInzoomInslideInYslideInX

usePassthroughSlots()

Forwards every slot of a wrapper component to the component it wraps, except the ones you exclude. Base components use it.

composables/usePassthroughSlots.ts
usePassthroughSlots(excluded: string[] = []): { passthroughSlots: any; }
ReturnspassthroughSlots

useComboboxLabel()

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.

composables/useComboboxLabel.ts
useComboboxLabel(fieldRef: Ref<unknown>): void

useSectionScrollSpy()

Tracks which section is in view and whether a navigation is sticky.

composables/useSectionScrollSpy.ts
useSectionScrollSpy(items: MaybeRefOrGetter<SectionScrollSpyItem[]>, options: SectionScrollSpyOptions = {}): { isSticky: any; activeIndex: any; update: () => void; }
ReturnsisStickyactiveIndexupdate

useRegionName()

regionName(code) returns a country name in the current language, from Intl.DisplayNames.

composables/useRegionName.ts
useRegionName(): { regionName: (code: string) => any; }
ReturnsregionName

usePrintElement()

Prints one element instead of the whole page and names the PDF after it. BaseDocument's print() uses it.

composables/usePrintElement.ts
usePrintElement(): { print: (target: MaybeElementRef, options?: PrintElementOptions) => void; }
Returnsprint

useNotifications()

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.

composables/useNotifications.ts
useNotifications(): { notifications: any; unreadCount: any; markRead: (id: string) => void; markAllRead: () => void; }
ReturnsnotificationsunreadCountmarkReadmarkAllRead
© 2026 melsami UI.
Developer documentation for melsami UI.