Skip to content

Getting Started

Installation

Install the component library and design tokens packages:

bash
pnpm add @liquid/ui @liquid/tokens

Or with npm / yarn:

bash
npm install @liquid/ui @liquid/tokens
# or
yarn add @liquid/ui @liquid/tokens

Setup

1. Import Design Tokens

Import the CSS token files in your app entry point. These provide all CSS variables used by the components:

typescript
// main.ts
import { createApp } from 'vue'
import App from './App.vue'

// Design tokens (required)
import '@liquid/tokens/colors.css'
import '@liquid/tokens/glass.css'

createApp(App).mount('#app')

2. Wrap with GlassFilterProvider

GlassFilterProvider injects the SVG filter definitions needed by glass-variant components (glass, glass-intense, glass-layered, etc.). Place it at your app root:

vue
<!-- App.vue -->
<script setup lang="ts">
import { GlassFilterProvider } from '@liquid/ui'
</script>

<template>
  <GlassFilterProvider>
    <!-- Your app content -->
    <RouterView />
  </GlassFilterProvider>
</template>

TIP

If you only use the glass-css-only variant (pure CSS, no SVG filters), GlassFilterProvider is optional.

3. Use Components

vue
<script setup lang="ts">
import { LiquidButton, LiquidCard, LiquidBadge } from '@liquid/ui'
</script>

<template>
  <LiquidCard variant="glass-css-only" padding="lg">
    <LiquidBadge color="primary">New Feature</LiquidBadge>
    <h2>Hello, Liquid Glass!</h2>
    <LiquidButton variant="primary">Get Started</LiquidButton>
  </LiquidCard>
</template>

Theming

All components use CSS custom properties from @liquid/tokens. Override them on any container to theme a section or the entire app.

Dark Theme

css
/* global.css */
body {
  background: #0f1117;
  /* Override card glass variables for dark backgrounds */
  --liquid-card-glass-bg: rgba(255, 255, 255, 0.05);
  --liquid-card-glass-border-color: rgba(255, 255, 255, 0.08);
}

Light Theme (Default)

The default token values are optimized for light backgrounds. The gradient background pattern used across this library's demos:

css
body {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf0ff 50%, #f0faff 100%);
  background-attachment: fixed;
}

Glass Variants

Each component supports multiple glass variants:

VariantDescriptionRequires GlassFilterProvider
defaultSolid white card, standard stylingNo
glass-css-onlyPure CSS glass via backdrop-filter and layered pseudo-elementsNo
glass-highlight-layeredCSS glass + #glass-highlight-only SVG filter for organic highlightYes

WARNING

For the best visual result with glass-css-only, ensure the element has a colorful or textured background visible behind it. Glass on a plain white background will have no visible blur effect.

Next Steps

Built with Vue 3 + Liquid Glass