tapcn
Components

Glass View

A Liquid Glass component for iOS 26+ with cross-platform fallback.

Glass EffectSemi-transparent card with backdrop blur.

Glass View

A container view that renders Apple's Liquid Glass effect on iOS 26+ (Expo SDK 54+). On older iOS, Android, and Web, it gracefully falls back to a semi-transparent background with backdrop blur (web) or a solid card background (native).

Installation

npx @tapcn/cli add glass-view

Or using shadcn directly:

npx shadcn@latest add https://tapcn.vercel.app/r/glass-view.json

Native Liquid Glass (optional)

To enable the native Liquid Glass effect on iOS 26+, install expo-glass-effect:

npx expo install expo-glass-effect

Without this package, the component renders a styled fallback that works on all platforms.

Usage

import { GlassView } from '~/components/ui/glass-view';
import { Text } from '~/components/ui/text';

export function Example() {
  return (
    <GlassView className="p-4">
      <Text variant="h4">Hello from Glass</Text>
      <Text className="text-muted-foreground">
        This card uses Liquid Glass on iOS 26+.
      </Text>
    </GlassView>
  );
}

Variants

The variant prop controls the glass opacity:

{/* More transparent */}
<GlassView variant="clear" className="p-4">
  <Text>Clear glass</Text>
</GlassView>

{/* More opaque */}
<GlassView variant="regular" className="p-4">
  <Text>Regular glass</Text>
</GlassView>

With tint color

<GlassView variant="clear" tintColor="#007AFF" className="p-4">
  <Text>Tinted glass</Text>
</GlassView>

Custom fallback styling

When Liquid Glass is not available, you can customize the fallback appearance:

<GlassView
  fallbackClassName="bg-primary/10 border border-primary/20"
  className="p-6 rounded-3xl"
>
  <Text>Custom fallback styling</Text>
</GlassView>

Checking availability

You can check if native Liquid Glass is available:

import { GlassView, isGlassAvailable } from '~/components/ui/glass-view';

function MyComponent() {
  return (
    <GlassView className="p-4">
      <Text>
        {isGlassAvailable ? 'Native Liquid Glass' : 'Fallback mode'}
      </Text>
    </GlassView>
  );
}

Props

PropTypeDefaultDescription
variant'clear' | 'regular''clear'Glass effect style. clear is more transparent, regular is more opaque.
tintColorstring-Optional tint color for the glass effect.
fallbackClassNamestring-Additional class names applied to the fallback View when Liquid Glass is not available.
classNamestring-Class names applied to the container.
styleViewStyle-Inline styles applied to the container.
childrenReactNode-Content to render inside the glass view.

All standard View props are also supported.

Exports

ExportDescription
GlassViewThe main glass view component.
isGlassAvailableBoolean indicating if native Liquid Glass is available on the current device.
GlassViewPropsTypeScript type for the component props.

How it works

  1. On import, the component attempts to load expo-glass-effect via require().
  2. If the package is installed and isGlassEffectAPIAvailable() returns true (iOS 26+), the native GlassView from expo-glass-effect is used.
  3. Otherwise, a standard View is rendered with platform-appropriate fallback styling:
    • Web: bg-background/80 with backdrop-blur-xl for a frosted glass effect.
    • Native (iOS/Android): bg-card/90 for a semi-transparent card background.

Dependencies

  • expo-glass-effect -- Optional. Required for native Liquid Glass on iOS 26+.

On this page