Liquid Glass
kokonut-ui/liquid-glass-cardFreeComponent
Liquid Glass inspired by @Apple
Live preview
live · rendered by the registry
Rendered by kokonut-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://kokonutui.com/r/liquid-glass-card.jsonSource
1"use client";23/**4 * @author: @dorianbaffier5 * @description: Liquid Glass Card - Optimized with Shadcn UI6 * @version: 2.0.07 * @date: 2025-10-118 * @license: MIT9 * @website: https://kokonutui.com10 * @github: https://github.com/kokonut-labs/kokonutui11 */1213import { cva, type VariantProps } from "class-variance-authority";14import {15 ArrowLeft,16 ArrowRight,17 MoreHorizontal,18 Pause,19 Play,20} from "lucide-react";21import Image from "next/image";22import React from "react";23import { Button, type ButtonProps } from "@/components/ui/button";24import { Card } from "@/components/ui/card";25import { cn } from "@/lib/utils";2627// Constants for better maintainability28const GLASS_SHADOW_LIGHT =29 "shadow-[0_0_6px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3px_rgba(0,0,0,0.9),inset_-3px_-3px_0.5px_-3px_rgba(0,0,0,0.85),inset_1px_1px_1px_-0.5px_rgba(0,0,0,0.6),inset_-1px_-1px_1px_-0.5px_rgba(0,0,0,0.6),inset_0_0_6px_6px_rgba(0,0,0,0.12),inset_0_0_2px_2px_rgba(0,0,0,0.06),0_0_12px_rgba(255,255,255,0.15)]";3031const GLASS_SHADOW_DARK =32 "dark:shadow-[0_0_8px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3.5px_rgba(255,255,255,0.09),inset_-3px_-3px_0.5px_-3.5px_rgba(255,255,255,0.85),inset_1px_1px_1px_-0.5px_rgba(255,255,255,0.6),inset_-1px_-1px_1px_-0.5px_rgba(255,255,255,0.6),inset_0_0_6px_6px_rgba(255,255,255,0.12),inset_0_0_2px_2px_rgba(255,255,255,0.06),0_0_12px_rgba(0,0,0,0.15)]";3334const GLASS_SHADOW = `${GLASS_SHADOW_LIGHT} ${GLASS_SHADOW_DARK}`;3536const DEFAULT_GLASS_FILTER_SCALE = 30;37const BUTTON_GLASS_FILTER_SCALE = 70;3839// Shared glass filter component40interface GlassFilterProps {41 id: string;42 scale?: number;43}4445const GlassFilter = React.memo(46 ({ id, scale = DEFAULT_GLASS_FILTER_SCALE }: GlassFilterProps) => (47 <svg aria-hidden="true" className="hidden" focusable={false}>48 <title>Glass Effect Filter</title>49 <defs>50 <filter51 colorInterpolationFilters="sRGB"52 height="200%"53 id={id}54 width="200%"55 x="-50%"56 y="-50%"57 >58 <feTurbulence59 baseFrequency="0.05 0.05"60 numOctaves="1"61 result="turbulence"62 seed="1"63 type="fractalNoise"64 />65 <feGaussianBlur66 in="turbulence"67 result="blurredNoise"68 stdDeviation="2"69 />70 <feDisplacementMap71 in="SourceGraphic"72 in2="blurredNoise"73// … truncated
What it pulls in
npm packages
Files it writes
More from kokonut-ui
All 40 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Action Search Baraction-search-bar | kokonut-ui | Components | Free | 2 deps · 2 files | |
| AI Input Searchai-input-search | kokonut-ui | Components | Free | 1 dep · 2 files | |
| AI State Loadingai-loading | kokonut-ui | Components | Free | 1 dep | |
| AI Input Selectorai-prompt | kokonut-ui | Components | Free | 2 deps · 4 files | |
| AI Text Loadingai-text-loading | kokonut-ui | Components | Free | 1 dep | |
| AI Voiceai-voice | kokonut-ui | Components | Free | 2 deps | |
| Apple Activity Cardapple-activity-card | kokonut-ui | Components | Free | 1 dep | |
| Magnet Buttonattract-button | kokonut-ui | Components | Free | 2 deps |
