All articles

Mobile10 min read

Liquid Glass in React Native with expo-glass-effect

How to use iOS 26 Liquid Glass in React Native with expo-glass-effect: GlassView, GlassContainer, Android fallback, tint, a merging chip and four demo components.

Also in Português, Español, Français

iOS 26 brought Liquid Glass: bars, buttons and cards that look like real glass, reflecting and bending whatever passes underneath. In React Native, you can use the system's own material with expo-glass-effect, without faking it with blur and transparency.

I put this glass on the tab bar of one of my apps, and the easy part was the first line of code. The hard part was everything else: devices without support, a chip that wouldn't merge, glass that disappeared on a light background and labels you couldn't read in dark mode.

For this post, I built a demo app with four new components (card, button, segmented control and tab bar) and ran it on the iPhone 17 Pro simulator with iOS 26.5. All the code is here.

The full project, ready to run, is on GitHub: yasminlopes/react-native-liquid-glass.

TL;DR#

  • GlassView only exists on iOS 26 and up. On Android and on outdated iPhones it becomes a plain View, so design the fallback on purpose.
  • Load the module with a guarded require and decide everything with a single switch (hasGlass), using isGlassEffectAPIAvailable() and isLiquidGlassAvailable().
  • No backgroundColor on the glass. The material gives the piece its body; a color on top wipes out the effect.
  • regular for surfaces, clear for glass on glass. On a light background, use tintColor, or the glass looks like a white panel.
  • The prop is colorScheme, not glassColorScheme. A wrong prop in React doesn't throw: it just vanishes.
  • For two pieces to merge inside GlassContainer, move them with left, not transform. The merge is calculated from the layout position.
  • Don't animate opacity on the glass. Switch glassEffectStyle instead, which has a native animation.

What expo-glass-effect is#

expo-glass-effect exposes iOS's UIVisualEffectView with the glass material. There are two components and two functions:

  • GlassView: a View with the glass material. It takes glassEffectStyle ('regular', 'clear' or 'none'), tintColor, isInteractive and colorScheme.
  • GlassContainer: groups several GlassViews so they merge when they get close, like the mercury drops in Apple's controls. The spacing prop sets the distance at which the merge starts.
  • isLiquidGlassAvailable(): tells you whether the app was compiled with support and whether the system has the material.
  • isGlassEffectAPIAvailable(): checks whether the API really exists on the device. It was added because some iOS 26 betas didn't have the API and the app crashed.

Installation is the usual:

npx expo install expo-glass-effect

It's a native module, so it has to be in the app's build. I ran the demo on a development build (expo-dev-client), compiled straight to the simulator.

The demo on iOS 26.5: cards, segmented control, button and tab bar in glass

1. Load the module with a safety net#

The first temptation is an import { GlassView } from 'expo-glass-effect' at the top of the file. It works, until someone opens the app on a build that doesn't have the module's native part yet, like a development build made before you installed the package. Then the import breaks, and it's not the component that goes down: it's every screen that imports it. In my case, that was the tab bar, present on every screen.

A native dependency that is optional comes in through a guarded require:

glass.ts
import type { ComponentType } from 'react';
import { View, type ViewProps } from 'react-native';
 
type GlassModule = typeof import('expo-glass-effect');
 
function load(): GlassModule | null {
  try {
    return require('expo-glass-effect') as GlassModule;
  } catch {
    return null;
  }
}
 
const glass = load();

2. A single switch for everything#

The glass affects several things at once: the material, the color of the text on top of it, the way the chip animates. If each component checks support its own way, sooner or later you get a combination nobody designed, like a transparent chip with white text on top.

So, a single switch:

glass.ts
/** Set EXPO_PUBLIC_FORCE_FALLBACK=1 to see what Android and iOS < 26 users get. */
const forceFallback = process.env.EXPO_PUBLIC_FORCE_FALLBACK === '1';
 
export const hasGlass: boolean = (() => {
  if (forceFallback || !glass) return false;
  try {
    return glass.isGlassEffectAPIAvailable() && glass.isLiquidGlassAvailable();
  } catch {
    return false;
  }
})();
 
type AnyView = ComponentType<ViewProps & Record<string, unknown>>;
 
/** The system glass when available, a plain View otherwise. */
export const GlassSurface: AnyView = hasGlass && glass ? (glass.GlassView as AnyView) : (View as AnyView);
 
/** Groups glass pieces so they merge when they get close. A plain View otherwise. */
export const GlassGroup: AnyView = hasGlass && glass ? (glass.GlassContainer as AnyView) : (View as AnyView);

The decision happens at runtime, not at build time: the same app runs on an iPhone with iOS 26 and on an Android, and each one lands in its own state.

EXPO_PUBLIC_FORCE_FALLBACK is a development shortcut: with it, you can see on the simulator itself what people without glass will see.

The same code without glass: solid surfaces, designed on purpose

3. No background color on the glass#

The card is the simplest component, and it already has a trap: if you pass backgroundColor to GlassView, the color sits on top of the material and the glass disappears. With glass, the system gives the piece its body. Without glass, that's when the white background with a shadow comes in:

GlassCard.tsx
export function GlassCard({ children, style }: { children: ReactNode; style?: StyleProp<ViewStyle> }) {
  return (
    <GlassSurface
      style={[styles.card, hasGlass ? null : styles.solid, style]}
      {...(hasGlass ? { glassEffectStyle: 'regular', colorScheme: 'light' } : {})}
    >
      {children}
    </GlassSurface>
  );
}
 
const styles = StyleSheet.create({
  card: { borderRadius: 28, padding: 20, overflow: 'hidden' },
  solid: {
    backgroundColor: '#ffffff',
    borderWidth: 1,
    borderColor: 'rgba(20, 20, 20, 0.08)',
    shadowColor: '#000',
    shadowOpacity: 0.12,
    shadowRadius: 24,
    shadowOffset: { width: 0, height: 12 },
  },
});

Notice the glass props are only passed when hasGlass is true. On a plain View, glassEffectStyle does nothing, but keeping everything conditional keeps the fallback clean and easy to read.

4. regular, clear and the tint#

glassEffectStyle has two materials:

  • regular: the denser glass, for surfaces with text on top (bar, card).
  • clear: more transparent, for small pieces or for glass on glass. Two dense glasses stacked turn into a blur.

And here came the first surprise in the real app: on an almost white background, regular glass looks exactly like a white panel. The material is there, but it doesn't show, because there's nothing colorful underneath for it to reflect. The fix is tintColor, a brand color with low alpha:

GlassTabBar.tsx
<GlassSurface
  style={[styles.bar, hasGlass ? null : styles.solidBar]}
  {...(hasGlass
    ? { glassEffectStyle: 'regular', colorScheme: 'light', tintColor: 'rgba(255, 56, 92, 0.05)' }
    : {})}
>

Strong enough for the material to show, weak enough for the labels to stay readable.

In dark mode, the tint becomes the piece's body#

In the app, dark mode brought the second surprise. regular glass with the weak tint stayed light over the almost black screen: the bar turned into a whitish lozenge, and the gray labels of the inactive tabs disappeared into it.

Two tweaks fixed it:

  • colorScheme with the app's theme ('light' or 'dark'), so the material follows your theme and not the system's. And watch out: at first I wrote glassColorScheme, which doesn't exist. An unknown prop in React throws no error and no warning, it just gets ignored, and the glass kept following the system until I reread the documentation.
  • In dark mode, a dark tint with high alpha. It pushes the material down and brings back the labels' contrast. In light mode, the same high alpha would make the bar a flat block of color, so the two themes have different values.

And the labels' contrast has to be measured on the glass, not on the screen background. The gray that passed easily over the dark background dropped to around 3:1 on the tinted bar, and I had to lighten the inactive label only when there's glass.

5. The merging chip#

The prettiest component, and the one that took the most work: a segmented control where the selected item's chip slides and merges with the track, like the native iOS control.

The structure is a GlassGroup (the GlassContainer) with the glass track inside and the chip, also glass, inside the track. The chip uses clear, because it's glass on glass.

In the app, the first version animated the chip with transform: translateX, the cheapest way to move something. The chip slid, but the two pieces never merged.

The reason: the GlassContainer merge is calculated by the system from each piece's layout position. transform moves what you see on screen, but it doesn't touch the frame; as far as iOS knew, the chip was still sitting in the corner. Two pieces that never get close never merge.

The fix is to move the chip with left, which is layout. Since animating layout with React Native's Animated runs on the JavaScript thread (and stutters badly when the screen changes), I use Reanimated:

GlassSegmented.tsx
const PAD = 4;
 
export function GlassSegmented({ options, value, onChange }: { options: string[]; value: number; onChange: (index: number) => void }) {
  const [width, setWidth] = useState(0);
  const slot = width > 0 ? (width - PAD * 2) / options.length : 0;
  const reduceMotion = useReducedMotion();
  const position = useSharedValue(value);
 
  useEffect(() => {
    position.value = reduceMotion ? value : withSpring(value, { damping: 18, stiffness: 180, mass: 0.9 });
  }, [value, reduceMotion, position]);
 
  // With glass the chip moves by `left` (layout), so the system can merge it with the track.
  // Without glass, `transform` is cheaper and there is nothing to merge.
  const chipStyle = useAnimatedStyle(() =>
    hasGlass
      ? { width: slot, left: PAD + position.value * slot }
      : { width: slot, left: PAD, transform: [{ translateX: position.value * slot }] },
  );
 
  return (
    <GlassGroup style={styles.group} {...(hasGlass ? { spacing: 16 } : {})}>
      <GlassSurface
        onLayout={(e) => setWidth(e.nativeEvent.layout.width)}
        style={[styles.track, hasGlass ? null : styles.solidTrack]}
        {...(hasGlass ? { glassEffectStyle: 'regular', colorScheme: 'light' } : {})}
      >
        {slot > 0 && (
          <Animated.View pointerEvents="none" style={[styles.chip, chipStyle]}>
            {hasGlass ? (
              <GlassSurface style={styles.chipFill} glassEffectStyle="clear" colorScheme="light" isInteractive />
            ) : (
              <View style={[styles.chipFill, styles.solidChip]} />
            )}
          </Animated.View>
        )}
        {options.map((label, index) => (
          <Pressable key={label} style={styles.option} onPress={() => onChange(index)} accessibilityRole="tab">
            <Text
              style={[
                styles.label,
                // White only works on the solid chip. On glass the chip is see-through.
                { color: index === value ? (hasGlass ? '#141414' : '#ffffff') : '#5c5c66' },
              ]}
            >
              {label}
            </Text>
          </Pressable>
        ))}
      </GlassSurface>
    </GlassGroup>
  );
}

Two more details that apply to any component with glass:

  • The active item's text color depends on hasGlass. Without glass, the chip is solid red and the text is white. With glass, the chip is transparent, and white text would vanish right on the selected tab.
  • useReducedMotion respects people who turned off animations in the system: the chip jumps into place instead of sliding.

6. Interactive button#

isInteractive makes the system itself react to touch: the glass shines and stretches a little when the finger lands, without a single line of animation from you.

GlassButton.tsx
<Pressable onPress={onPress} accessibilityRole="button">
  <GlassSurface
    style={[styles.button, hasGlass ? null : styles.solid]}
    {...(hasGlass ? { glassEffectStyle: 'regular', isInteractive: true, tintColor: 'rgba(255, 56, 92, 0.35)' } : {})}
  >
    <Text style={[styles.label, { color: hasGlass ? '#141414' : '#ffffff' }]}>{label}</Text>
  </GlassSurface>
</Pressable>

Don't animate the glass's opacity#

Apple doesn't recommend opacity below 1 on the glass or on its parents: with low opacity, the effect simply doesn't render. To show and hide it, glassEffectStyle takes an object with a native animation:

<GlassView
  glassEffectStyle={{ style: visible ? 'regular' : 'none', animate: true, animationDuration: 0.5 }}
/>

The tab bar: shape is layout, material is system#

One last lesson, more about product than code. The floating tab bar, with the sliding chip, has two parts:

  • the shape (a pill floating above the content, away from the edge), which is layout and works on any device;
  • the material (glass), which only exists on iOS 26.

Separating the two is what made the decision easy: everyone got the new bar, and people on iOS 26 got the glass too. Nobody ended up with a broken bar for lack of support.

Checklist#

  • npx expo install expo-glass-effect and a new build of the app.
  • Module loaded with a guarded require.
  • A single switch (hasGlass) with both checks, and a way to force the fallback on the simulator.
  • No backgroundColor on GlassView.
  • regular for surfaces, clear for glass on glass, tintColor on a light background.
  • colorScheme following the app's theme, and a stronger tint in dark mode.
  • Text contrast measured on the glass.
  • Pieces that merge inside a GlassContainer, moved with left.
  • No opacity on the glass; use the animated glassEffectStyle.
  • A screenshot with glass and without glass before calling it done.

References#

  • Mobile
  • react-native
  • expo
  • ios
  • liquid glass
  • reanimated

Written by

Software engineer and designer. I write about what I run into while building apps, APIs and products.