API

Options

Options for the whole app, and functions.

Setting them

export default defineNuxtConfig({
  modules: ['boneprint/nuxt'],
  boneprint: {
    reveal: 'sequence',
  },
})
OptionDefaultPurpose
persisttrueremember shapes between visits
debugfalseoutline every skeleton and report whether the page moved, see Debugging
revealfadehow content replaces the skeleton: fade, sequence or sweep

persist and reveal can also be set on one skeleton as props.

forgetSkeletons()

Clears the remembered shapes. Whatever is on screen won't be written back, even as it unmounts. Call it on sign-out.

forgetSkeletons()

Auto-imported in Nuxt. In Vue, import { forgetSkeletons } from 'boneprint', or add it to auto-imports as shown in Vue + Vite.

useInSkeleton()

true inside the copy of the slot a skeleton is measured from, false everywhere else. Use it to keep a component in the slot from fetching or observing twice, see Side effects in the slot.

const inSkeleton = useInSkeleton()

Auto-imported in Nuxt. In Vue, import { useInSkeleton } from 'boneprint'.

Entry points

ImportFor
boneprint/nuxtthe Nuxt module
boneprintVue: the components, forgetSkeletons, useInSkeleton and the boneprint plugin
boneprint/resolverboneprintResolver() for unplugin-vue-components