Skip to content
Syno Package Land
Language: English

UI components

@synopackageland/ui is a Vue 3 component library that follows DSM 7 styling. The default native-go project uses it for a sidebar shell, a status page and a page per capability; those pages come from @synopackageland/sdk/vue in the SDK.

Terminal window
synopkgland init -t native-go --ui plain my-plain-app

The default --ui vue project needs no flag. For an existing project, install both packages in frontend/ and commit the lockfile:

Terminal window
pnpm add --save-exact @synopackageland/ui @synopackageland/sdk --registry=https://registry.npmjs.org

pnpm install --frozen-lockfile then installs exactly that; the NAS never downloads npm packages (build bundles everything).

Vue (default)Plain (--ui plain)
Sourcefrontend/src/ (Vue 3, Vite, TypeScript)ui/app.js, ui/app.css
Buildpnpm run build in frontend/, started by synopkgland buildnone
Files, jobs, delegate screensincludednot included
Standalone login (--with login)supportedrefused by check and init
Components@synopackageland/ui, @synopackageland/sdk/vuewrite your own

A window built with @synopackageland/ui opens in a DSM window; other frontends declare ui.launch themselves (see launch mode).

A plain app.js registers the window with window.DsmPackageApps[<package>].mount(root, ctx) and reads its package name from document.currentScript.

Every DSM window shares one page with the desktop. Import the embedded theme instead of theme.css, wrap the app in AppRoot, and give each mounted app a unique idPrefix.

import { createApp } from 'vue'
import App from './App.vue'
import '@synopackageland/ui/themes/dsm7-embedded.css'
export function mount(root: HTMLElement, ctx: unknown) {
const app = createApp(App, { ctx })
app.config.idPrefix = `my-package-${crypto.getRandomValues(new Uint32Array(4)).join('-')}`
app.mount(root)
return { unmount: () => app.unmount() }
}

Keep the generated mount registration in frontend/src/main.ts for the DSM window loader.

<script setup lang="ts">
import { AppRoot, ConfigProvider } from '@synopackageland/ui'
</script>
<template>
<AppRoot modal-scope="app" style="height: 100%">
<ConfigProvider locale="en">
<!-- your pages -->
</ConfigProvider>
</AppRoot>
</template>

AppRoot scopes the theme and sends dialogs, menus and toasts into itself, so they stay inside the window. modal-scope="app" (the default) blocks only your app; a full-page app may use modal-scope="document", never inside a DSM window. Give the root a bounded size such as height: 100%; do not import theme.css.

<script setup lang="ts">
import { AppLayout, AppSidebar, PageContent, PageHeader } from '@synopackageland/ui'
</script>
<template>
<AppLayout min-height="0" wide-layout="window">
<template #sidebar>
<AppSidebar v-model="page" :groups="groups" />
</template>
<PageContent>
<PageHeader title="Status" description="MyApp" />
</PageContent>
</AppLayout>
</template>

AppLayout has sidebar, toolbar, default and footer slots. Keep wide-layout="window" in a DSM window, so a maximized window keeps its layout; wide-layout="web" is only for a full-page Portal app (see Application Portal). Below 600 px, navigation becomes a slide-out. The generated shell keeps every page mounted with v-show, so polling continues on hidden pages. PageContent surface="none" gives full-bleed content; PageContent and AppToolbar use 16 px page spacing in full-page layouts.

PageInfo from @synopackageland/sdk/vue puts an information button beside the page title, before custom #meta content. Non-empty notes appear as a list; empty ones are omitted, and an empty list hides the button unless the default slot replaces it. The button uses the shell’s language and note count, and opens on click or keyboard focus; Escape closes it.

inline keeps the button at its declared position, also without AppShell; label overrides the accessible name. side and align pass through to InfoTip and default to bottom and start; a standalone page can provide PageInfoTarget and point it at its header.

PageHeader keeps its title and meta on one row; actions that do not fit move below it and align right, and a long title truncates with a title attribute holding the full text.

Import from @synopackageland/ui only, never by file path.

ComponentUse
AppRoot, ConfigProviderApp root, language
AppLayout, AppSidebar, PageContent, PageHeaderWindow layout
Button, Input, Textarea, Select, Checkbox, SwitchControls
Form, FormItem, FormActionsForms; labels stack below 520 px
SettingsSection, Callout, EmptyState, LoadingArea, ProgressSettings, messages, states
Dialog, ToastProvider, useToastDialogs and toasts; useToast needs a ToastProvider parent
TreeViewHierarchy with nodes, v-model, v-model:expanded, loadChildren
DataGridTable with columns, rows, row-key, sorting, selectable, page-size and typed columns; truncated cells tooltip their text
FilePickerFiles from the user’s computer

Use library controls instead of native <select>, <input>, <label> or <a>. Icons come from @lucide/vue, which the project lists itself.

To discover props, slots and events, run from frontend/:

Terminal window
pnpm exec syno-pkg-land-ui catalog
pnpm exec syno-pkg-land-ui describe Button

NasPicker and FileBrowser come from @synopackageland/sdk/vue, not @synopackageland/ui. FileBrowser combines TreeView and DataGrid over the user’s File Station view; NasPicker puts it in a dialog.

<NasPicker v-model:open="open" :provider="provider" :locale="ctx.locale" mode="file" @selected="path = $event" />
NasPicker prop or eventMeaning
open (v-model:open)Dialog visibility
providerFrom createNasProvider(ctx) in @synopackageland/sdk
localectx.locale
mode'file' or 'folder'
selected eventEmits the chosen path

Picking a path grants nothing; the backend checks the session and permissions again. See Files.

FilePicker returns browser File objects and does not know the NAS; the generated file browser limits uploads to one file of at most 16 GiB:

<FilePicker v-model="uploads" variant="compact" :max-files="1" :max-size="16 * 1024 ** 3" @rejected="onRejected" />
FilePicker propMeaning
v-modelSelected File[]
accept, multiple, directoryWhat can be chosen
maxFiles, maxSizeCount and size limits in bytes; a rejected file raises rejected with a reason of type, size, count or duplicate
variant'dropzone' or 'compact'

Override tokens on your own app root, after the library stylesheet, with a selector that cannot match other apps. Set data-package on AppRoot.

[data-ui-app][data-package='my-package'] {
--ui-primary: #0086e5;
}

Put data-ui-density="compact" on an element to tighten controls and spacing inside it. Keep your CSS out of cascade layers; for bare-element base rules, load dsm7-embedded-reset.css, then your CSS, then dsm7-embedded-theme.css (together they equal dsm7-embedded.css).

The library translates its own text (file picker, dialog buttons, link annotations) in the nine app languages: en, zh-TW, zh-CN, ja, ko, de, fr, es and it. Set ConfigProvider locale from ctx.locale; uiLocale maps DSM codes such as cht. Your own text lives in frontend/src/i18n/<locale>.json, see Native apps.

ItemLimit
Browser upload through the file browser1 file, 16 GiB
Smallest DSM window700 px wide, set by the generated window
Overlays in a DSM windowApp-local only; do not mix app-local and document-wide overlays
SymptomCauseFix
Dialog or menu appears outside the windowApp is not inside AppRootWrap the app in AppRoot
Margins and fonts look wrongtheme.css loaded instead of the embedded themeImport themes/dsm7-embedded.css
Build says node_modules is missingbuild does not install packagesRun pnpm install in frontend/

Render AppShell as soon as the entry gate passes and bind :loading="!ready". The sidebar and title appear while startup reads run; the page shows its loading area and actions wait.