Foundations
Appearance and customizer
Dark mode, primary colours, menu style, layouts, content width, density and right-to-left.
The customizer (the palette icon in the navbar) lets every user adjust the app. Their choices are stored in cookies, so the server renders the right version on the first request.
The options
Option | Values | Default |
|---|---|---|
| Theme | light, dark, system | system |
primary | Any id in PRIMARY_PRESETS | melsami |
menu | light, semi-dark | light |
layout | vertical, horizontal, collapsed | vertical |
contentWidth | boxed, full | boxed |
direction | ltr, rtl | ltr |
density | comfortable, compact | comfortable |
The theme is stored in the app-theme cookie and the rest in app-appearance. normalizeAppearance() validates the cookie, so an old or edited value falls back to the defaults.
Change the defaults
Edit DEFAULT_APPEARANCE in config/appearance.config.ts:
export const DEFAULT_APPEARANCE: AppearancePreferences = {
primary: DEFAULT_PRIMARY_PRESET,
menu: 'semi-dark',
layout: 'horizontal',
contentWidth: 'boxed',
direction: 'ltr',
density: 'comfortable',
}
To remove an option for everybody, set the default and remove its section from AppCustomizer.
Turn shell features off
APP_FEATURES in config/features.config.ts switches off whole pieces of the shell, everywhere they appear:
export const APP_FEATURES: AppFeatures = {
customizer: false,
commandPalette: true,
themeToggle: true,
languageSwitcher: true,
notifications: false,
shortcutsDialog: true,
}
Key | What it removes |
|---|---|
customizer | The customizer drawer and its buttons in the app bar and the user menu. Visitors keep the defaults above. |
commandPalette | The palette, its Ctrl/⌘ K shortcut, the search trigger in the app bar and the search button of the 404 page. |
themeToggle | The light/dark/system button in the app, the landing, the auth and the status pages. |
languageSwitcher | The language menu everywhere. It also hides on its own when only one language is configured. |
notifications | The notifications menu in the app bar. |
shortcutsDialog | The keyboard shortcuts sheet opened with ?. |
Read and change preferences
const preferences = usePreferencesStore()
preferences.isDark
preferences.appearance.layout
preferences.setThemeMode('dark')
preferences.setAppearance('density', 'compact')
preferences.resetAppearance()
useThemeControl() wraps the theme toggle (icon, label and action) used by AppThemeToggle.
How it is applied
useAppearance() runs once in app.vue. It:
- switches the Vuetify theme when the theme changes;
- writes the chosen preset into the
light,darkandsidebarthemes (primary,secondary,tertiary,accent, plusnav-activeand the first two chart colours); - sets Vuetify's
rtland thedirattribute of<html>.
Dark mode without a flash
The system theme is resolved after onNuxtReady. Resolving prefers-color-scheme during hydration would make the browser render a different theme than the server, and the mismatch can leave animated elements invisible. A small inline script in nuxt.config.ts swaps the theme class before the first paint when the server guessed wrong, and saves the result in the app-theme-resolved cookie for the next request.
Layouts
- Vertical: the sidebar is a permanent drawer.
- Collapsed: the sidebar starts in rail mode and expands on hover.
- Horizontal:
AppHorizontalNavrenders the menu as dropdowns in the app bar, one per section, and the sidebar becomes temporary.
Right-to-left
With direction: 'rtl' the whole layout mirrors. For your own code:
- Use logical spacing classes:
ms-*,me-*,ps-*,pe-*instead ofml-*,mr-*. - Use logical CSS:
inset-inline-start,margin-inline-end,border-inline-start. - Choose direction-aware icons from
useRtl().isRtlwhen an arrow must point forward.