---
title: "Installation"
description: "Add it to a Vue app or a Nuxt app."
canonical_url: "https://liquid-glass.bodbod.ir/docs/getting-started/installation"
---
# Installation

> Add it to a Vue app or a Nuxt app.

<code-group>

```bash [pnpm]
pnpm add @mahbodhastam/liquid-glass
```

```bash [npm]
npm install @mahbodhastam/liquid-glass
```

</code-group>

If you want glass over arbitrary HTML and not just an image or video, also install snapDOM. It's what takes the snapshot (see [Backdrops](https://liquid-glass.bodbod.ir/docs/guide/backdrops)):

```bash
pnpm add @zumer/snapdom
```

## Vue

Register the plugin once. The `capture` option is only needed for `<LiquidGlassBackdrop>`, and the snapDOM chunk is only downloaded when a snapshot is used.

```ts [main.ts]
import { createLiquidGlass } from '@mahbodhastam/liquid-glass'

app.use(createLiquidGlass({
  capture: () => import('@mahbodhastam/liquid-glass/snapdom'),
}))
```

Then use the component. Point `source` at the image behind it:

```vue
<script setup lang="ts">
import { ref } from 'vue'

const hero = ref<HTMLImageElement | null>(null)
</script>

<template>
  <section class="relative">
    <img ref="hero" src="/hero.jpg" alt="" class="absolute inset-0 size-full object-cover">
    <LiquidGlass :source="hero" class="rounded-3xl p-6" :blur="12" :refraction="0.4">
      <h2>Content stays real DOM</h2>
    </LiquidGlass>
  </section>
</template>
```

You can skip the plugin and import the components where you use them:

```ts
import { LiquidGlass, LiquidGlassBackdrop } from '@mahbodhastam/liquid-glass'
```

## Nuxt

Add the module and, if you like, set some defaults:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  modules: ['@mahbodhastam/liquid-glass/nuxt'],
  liquidGlass: {
    prefix: '', // e.g. 'U' gives you <ULiquidGlass>
    quality: 'auto',
    maxDpr: 1.5,
    defaults: { blur: 12 },
    snapshot: 'auto', // sets up snapDOM for you if @zumer/snapdom is installed
  },
})
```

The module auto-imports `<LiquidGlass>`, `<LiquidGlassBackdrop>`, `useLiquidGlass` and `useLiquidGlassPreferences`. It's tested with `ssr: true` and with `nuxt generate`.


## Sitemap

See the full [sitemap](https://liquid-glass.bodbod.ir/sitemap.md) for all pages.
