Created
August 21, 2025 19:38
-
-
Save Kudo/a90e4e1d0f019b22e6e18252b73db639 to your computer and use it in GitHub Desktop.
expo-ui glassEffect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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