glasscn
ShowcaseDocsComponentsStudioThemingNative
5Get started
Guides
IntroductionInstallationThemingFonts & typeStudioReact Native
Surfaces
AuroraBackdropGlassLiquid glassCardTheme scopeBackground extensionScroll areaAccordionCollapsibleAlertItemEmpty
Typography
TypographyProse
Controls
ButtonBadgeInputTextareaLabelSwitchCheckboxSegmented controlTabsGlass groupGlass clusterGlass morphSliderProgressKbdSeparatorAvatarGlass preferencesComboboxCalendarDate pickerSpinnerSkeletonSelectRadio groupFieldInput groupButton groupToggleToggle groupStepper
Overlays
DialogAlert dialogSheetAction sheetPopoverTooltipDropdown menuToasterCommandDrawerContext menuConfirmation popover
Navigation
DockToolbarScroll edgeNavigation barSidebarSearch fieldGrouped list
Data
Activity ringsProgress ringSparklineStatKPIWidgetRange chartBar listGaugeTrackerCategory barHeatmapChartArea chartBar chartLine chartDonut chartTableData table
Chat
ChatChat markdownChat parts
Blocks
More Apple glass examplesLiquid Glass examplesDashboardAnalyticsSettingsSign inChat
glasscn — a shadcn registry. Copy it, own it, change it.DocsThemingregistry.json
Surfaces

Liquid glass

A floating regular or clear lens with optical edge refraction, pointer illumination and optional light tracking. Dim bright media beneath clear controls.

Installation

pnpm dlx shadcn@latest add https://glasscn.app/r/liquid-glass.json

React Native (iOS, Android and web through react-native-web) — same parts and props:

pnpm dlx shadcn@latest add https://glasscn.app/r/native-liquid-glass.json

Or with the namespace set up: shadcn add @glasscn-app/liquid-glass

Props

PropTypeDefault
variant"regular" | "clear"

Regular diffuses content. Clear is for media; dim bright media behind it separately.

"regular"
optics (web)boolean

Enable Chromium edge displacement. Other engines keep the CSS material. Native uses the OS effect and has no optics prop.

true
interactiveboolean

Elastic press response. Put accessible buttons inside the surface or use asChild.

false
followLight (web)boolean

Point the rim toward a fine pointer; disabled under reduced motion. Native illumination belongs to the OS.

false

For the whole app, install glass-effects and render <GlassEffects /> once near the root. It enhances floating controls and newly opened portals. LiquidGlass installs the shared runtime automatically.

The bounded convex-lens model is a glasscn web approximation. Apple does not publish its compositor shader or numeric material constants. Native uses regular or clear system glass untinted by default.

Source

components/glass/liquid-glass.tsx
"use client"

import * as React from "react"
import { cn } from "@/lib/glass-cn"

import { Glass } from "@/components/glass/glass"
import { GlassEffects } from "@/components/glass/glass-effects"

const subscribeHydration = () => () => {}

/** A floating lens. For clear glass, dim bright media underneath with Backdrop, not the lens. */
export function LiquidGlass({
  variant = "regular",
  optics = true,
  followLight = false,
  interactive = false,
  className,
  ...props
}: Omit<React.ComponentProps<typeof Glass>, "variant" | "intensity"> & {
  variant?: "regular" | "clear"
  optics?: boolean
  followLight?: boolean
  interactive?: boolean
}) {
  const hydrated = React.useSyncExternalStore(subscribeHydration, () => true, () => false)
  return (
    <>
      <GlassEffects enabled={optics} />
      <Glass
        data-slot="liquid-glass"
        data-liquid-surface=""
        data-glass-ready={hydrated ? "" : undefined}
        data-glass-optics={optics ? undefined : "off"}
        data-glass-follow-light={followLight ? "" : undefined}
        variant={variant === "clear" ? "liquid-clear" : "liquid"}
        className={cn("glass-illuminate", interactive && "glass-press-liquid", className)}
        {...props}
      />
    </>
  )
}
GlassCard
Alpine lake

Sierra Nevada

June 14 · 7:24 AM