Skip to content

Instantly share code, notes, and snippets.

@Kudo
Created August 21, 2025 19:38
Show Gist options
  • Select an option

  • Save Kudo/a90e4e1d0f019b22e6e18252b73db639 to your computer and use it in GitHub Desktop.

Select an option

Save Kudo/a90e4e1d0f019b22e6e18252b73db639 to your computer and use it in GitHub Desktop.
expo-ui glassEffect
import { Host, Text, VStack } from '@expo/ui/swift-ui';
import { glassEffect, padding } from '@expo/ui/swift-ui/modifiers';
import { Image } from 'expo-image';
export default function Index() {
return (
<>
<Image
source={{ uri: `https://picsum.photos/seed/${Math.random()}/600/800` }}
style={{ flex: 1 }}
/>
<Host
style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}
>
<VStack spacing={8}>
<Text
modifiers={[
padding({
all: 16,
}),
glassEffect({
glass: {
variant: 'regular',
},
}),
]}
>
Glass effect - regular
</Text>
<Text
modifiers={[
padding({
all: 16,
}),
glassEffect({
glass: {
variant: 'clear',
},
}),
]}
>
Glass effect - clear
</Text>
</VStack>
</Host>
</>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment