Skip to the content.

Nuxt Layer Base (@tgmc/nuxt-layer-base)

@tgmc/nuxt-layer-base is the Nuxt 4 layer every TGMC app extends. It loads the theme, wires Sass for Vue styles, provides two accessibility components and the shared overlay and motion helpers, and sets up @nuxt/a11y, the tgmc: feature flags and (unless icon: false) @nuxt/icon. core/web and core/admin get it through @tgmc/nuxt-layer-ui (admin via @tgmc/web-layer-admin), which extends it and adds PrimeVue and the Ui* kit.

What it provides

Feature flags

What each flag turns off, and how the build matrix proves it: nuxt-layers.md § 1a.

Theme stylesheet and Sass

Accessibility

Overlay and motion helpers

One copy of each, shared by core/web and core/admin. Utilities live in app/utils and composables in app/composables, all auto-imported.

Icons

@nuxt/icon with Lucide as inline SVG from the app’s own server bundle (tgmcIconConfig() in src/config/icons.ts). TGMC_BASE_ICONS lists the names pre-bundled for every app; each app lists only its extra names in icon.clientBundle.icons. See icons.md. The feature module installs @nuxt/icon unless tgmc: { icon: false }; then <Icon> renders nothing.

charset and viewport come from Nuxt’s app.head defaults. html lang belongs to the app (it conflicts with @nuxtjs/i18n).

Utilities

The layer auto-imports no utilities. Import SSR-safe helpers explicitly from @tgmc/utilities/universal (utilities.md), and never import @tgmc/utilities/browser into SSR code.

Usage

import { defineNuxtConfig } from 'nuxt/config';

export default defineNuxtConfig({
  extends: ['@tgmc/nuxt-layer-base'],
});

An app with a UI (PrimeVue and the Ui* kit) extends @tgmc/nuxt-layer-ui instead, which extends this layer. core/web and core/admin both do.

@tgmc/theme, @nuxt/icon and @iconify-json/lucide are optional peers: declare the ones whose feature the app keeps on, or turn the feature off with tgmc: { theme: false } / tgmc: { icon: false } (nuxt-layers.md § 1a).

Development