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
Surfacesradix-ui

Glass

A glass pane — material (content) or liquid (control layer, regular or clear). Intensity, tint and elevation variants; asChild.

Installation

pnpm dlx shadcn@latest add https://glasscn.app/r/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-glass.json

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

Props

PropTypeDefault
variant"material" | "liquid" | "liquid-clear"

material: the content layer (cards, panes), frosted by intensity. liquid: the control layer floating over content (toolbars, floating buttons). liquid-clear: over photos and video only. Never liquid inside liquid — use fills inside it.

"material"
intensity"ultraThin" | "thin" | "regular" | "thick" | "default" | "strong" | "subtle"

Four named standard materials; existing subtle/default/strong names map to ultraThin/thin/regular. Web values approximate native system materials.

"default"
tint"none" | "primary" | "destructive"

Mixes a colour into the frost via --glass-bg.

"none"
elevation"raised" | "flat"

Drop shadow on or off (--glass-elevation).

"raised"
asChildboolean

Render the child element as the pane.

false

Source

components/glass/glass.tsx
import * as React from "react"
import { cn } from "@/lib/glass-cn"
import { Slot } from "radix-ui"

import { glassVariants, type GlassVariantProps } from "@/lib/glass-variants"

/**
 * A frosted pane: the base every glasscn surface is made from.
 * Blurs and saturates whatever is behind it, rimmed with a light edge.
 *
 * `variant="material"` (default) is the content layer — cards and panes, frosted by
 * `intensity`. `variant="liquid"` is the control layer — things floating over content
 * (toolbars, floating buttons). `variant="liquid-clear"` is for over photos and video only.
 * Never put liquid inside liquid: inside a liquid pane use fills (`bg-fill`).
 */
function Glass({
  className,
  variant,
  intensity,
  tint,
  elevation,
  asChild = false,
  ...props
}: React.ComponentProps<"div"> & GlassVariantProps & { asChild?: boolean }) {
  const Comp = asChild ? Slot.Root : "div"
  return (
    <Comp
      data-slot="glass"
      data-variant={variant ?? "material"}
      data-intensity={intensity ?? "default"}
      className={cn(glassVariants({ variant, intensity, tint, elevation }), "rounded-surface", className)}
      {...props}
    />
  )
}

export { Glass, glassVariants }
BackdropLiquid glass
Subtle
Default
Strong
Tinted
Flat — no drop shadow

Thursday · Field notes

A week on the coast

Up before the light again. The tide was out far enough to walk to the rocks, and the wind dropped just as the sun cleared the dunes.

Wrote three pages at the café by the harbour. Kept the promise to stop at nine. Tomorrow: the lighthouse path, and no phone until noon.

Scroll — the toolbar and the dock stay legible over whatever passes beneath, because they are liquid glass and the article is not.

Regular — over content. One prominent action.
0:42
2:05
Clear — over media only, with a dim. Never beside regular.