Configuration

Every option, its default and what it controls.

Configuration

All options live under the skeletonizer key in nuxt.config.ts:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-skeletonizer'],
  skeletonizer: {
    enabled: true,
    autoScan: true,
    shimmer: true,
    shimmerDuration: 1200,
    animation: 'wave',
    baseColor: '#e5e7eb',
    highlightColor: '#f8fafc',
    darkBaseColor: '#2a2a2a',
    darkHighlightColor: '#3a3a3a',
    borderRadius: '0.375rem',
    opacity: 1,
    respectBorderRadius: true,
    debug: false,
    darkModeSelector: '.dark',
    scanDebounce: 50,
    maxScanDepth: 64,

    // Step 3 — adaptive engine (all opt-in, default off)
    adaptive: false,
    minFps: 45,
    layoutCache: false,
    telemetry: false,
    offThread: false,
    explain: false,

    // SVG rendering
    svgPrecision: 1,
    svgSharedGradient: true,
  },
})

Options

OptionTypeDefaultDescription
enabledbooleantrueMaster switch and initial global state.
autoScanbooleantrueRun the automatic DOM-scan engine.
shimmerbooleantrueEnable the highlight animation.
shimmerDurationnumber1200Animation cycle in milliseconds.
animationstring'wave'wave | pulse | fade | gradient | shine | none.
baseColorstring#e5e7ebLight-theme bone color.
highlightColorstring#f8fafcLight-theme highlight color.
darkBaseColorstring#2a2a2aDark-theme bone color.
darkHighlightColorstring#3a3a3aDark-theme highlight color.
borderRadiusstring0.375remDefault bone radius.
opacitynumber1Resting bone opacity.
respectBorderRadiusbooleantrueKeep each element's own radius.
debugbooleanfalseVerbose engine logging.
darkModeSelectorstring.darkSelector that activates dark colors.
scanDebouncenumber50MutationObserver debounce (ms).
maxScanDepthnumber64Safety cap for deep trees.

Adaptive engine (Step 3)

These power the adaptive engine. All default off, so the module behaves exactly as before unless you opt in. See it live in the Performance Lab.

OptionTypeDefaultDescription
adaptivebooleanfalseMaster switch for the Adaptive Performance Engine (FPS-driven animation degradation, shimmer auto-disable).
minFpsnumber45FPS floor; sustained drops degrade the animation (wave → pulse → none).
layoutCachefalse | 'memory' | 'session'falseCache + replay SVG blueprints by structural fingerprint ('memory' for the session in RAM, 'session' for sessionStorage).
telemetrybooleanfalseCollect per-stage timings, FPS, SVG node count and cache ratio.
offThreadbooleanfalseOffload fingerprint/telemetry compute to a Web Worker / requestIdleCallback.
explainbooleanfalseEmit natural-language explanations of engine decisions.

SVG rendering

Nuxt Skeletonizer renders a single <svg> overlay for each host — every measured node becomes a <rect> (or a <circle> for avatars), driven by one shared shimmer gradient. These options control that output.

OptionTypeDefaultDescription
renderMode'svg''svg'The render backend. Read-only — SVG is the only backend. Exposed for introspection.
svgPrecisionnumber1Decimal digits used when rounding SVG coordinates. Lower = smaller markup; higher = more precise placement.
svgSharedGradientbooleantrueUse one <linearGradient> in <defs> shared by every shape (true), or a separate gradient per shape (false).

Runtime config

Every value is exposed on runtimeConfig.public.skeletonizer, so you can override it per environment with NUXT_PUBLIC_SKELETONIZER_* env variables — no rebuild required.

App-level theme

You can also change colors, animation and duration at runtime via the composable (setTheme, setAnimation) — see Theming.