### Install expo-liquid-glass-view Package
Source: https://github.com/rit3zh/expo-liquid-glass-view/blob/main/README.md
This command installs the expo-liquid-glass-view package using the Expo CLI. Ensure you have Expo CLI installed and are in your project directory.
```bash
npx expo install expo-liquid-glass-view
```
--------------------------------
### Install CocoaPods for iOS Dependencies
Source: https://github.com/rit3zh/expo-liquid-glass-view/blob/main/README.md
This command installs the necessary iOS native dependencies using CocoaPods. Navigate to the 'ios' directory within your project before running this command.
```bash
cd ios && pod install
```
--------------------------------
### Basic Usage of ExpoLiquidGlassView in React Native
Source: https://github.com/rit3zh/expo-liquid-glass-view/blob/main/README.md
This example demonstrates how to use the ExpoLiquidGlassView component in a React Native application. It shows how to import the component and apply various props like cornerStyle, type, tint, cornerRadius, and style. The component also accepts children, which are rendered within the glass view.
```tsx
import { ExpoLiquidGlassView } from "expo-liquid-glass-view";
import { CornerStyle, LiquidGlassType } from "expo-liquid-glass-view";
import { Text } from "react-native";
export default function App() {
return (
Liquid Glass ✨
);
}
```
--------------------------------
### Apply Different Glass Effect Types with ExpoLiquidGlassView
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
Showcases the usage of ExpoLiquidGlassView with different LiquidGlassType options (Clear, Regular, Tint, Interactive, Identity) to create varied visual effects. This example iterates through predefined glass types and applies them to individual views, demonstrating how each type affects the appearance over a background image.
```tsx
import { ExpoLiquidGlassView, LiquidGlassType } from 'expo-liquid-glass-view';
import { View, Text, ImageBackground, StyleSheet } from 'react-native';
export default function GlassTypesDemo() {
const glassTypes = [
{ type: LiquidGlassType.Clear, label: 'Clear' },
{ type: LiquidGlassType.Regular, label: 'Regular' },
{ type: LiquidGlassType.Tint, label: 'Tint' },
{ type: LiquidGlassType.Interactive, label: 'Interactive' },
{ type: LiquidGlassType.Identity, label: 'Identity' },
];
return (
{glassTypes.map((item, index) => (
{item.label}
))}
);
}
const styles = StyleSheet.create({
background: {
flex: 1,
justifyContent: 'space-around',
alignItems: 'center',
padding: 20,
},
glassBox: {
width: 200,
height: 80,
justifyContent: 'center',
alignItems: 'center',
},
label: {
fontSize: 18,
color: '#fff',
fontWeight: '600',
},
});
```
--------------------------------
### Apply Different Corner Styles to Glass Effects (React Native)
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
Illustrates how to use different corner styles for glass effects with ExpoLiquidGlassView. You can choose between 'Continuous' for smooth curves or 'Circular' for perfect arcs by setting the 'cornerStyle' prop. This example also shows how a large corner radius with 'Circular' style can create a pill shape. It requires the 'expo-liquid-glass-view' and 'react-native' libraries.
```tsx
import { ExpoLiquidGlassView, CornerStyle, LiquidGlassType } from 'expo-liquid-glass-view';
import { View, Text, StyleSheet } from 'react-native';
export default function CornerStylesExample() {
return (
Continuous Corners
Smooth, flowing curves
Circular Corners
Perfect circular arcs
Pill Shape
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-evenly',
alignItems: 'center',
backgroundColor: '#0f0f1e',
},
glass: {
width: 300,
height: 120,
justifyContent: 'center',
alignItems: 'center',
padding: 16,
},
pill: {
width: 200,
height: 60,
justifyContent: 'center',
alignItems: 'center',
},
label: {
fontSize: 18,
fontWeight: 'bold',
color: '#fff',
},
description: {
fontSize: 14,
color: '#aaa',
marginTop: 4,
},
});
```
--------------------------------
### Render Complex Content with Glass Effects in React Native
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
This snippet showcases how to render complex React Native components, such as a profile card with an image, text, and stats, within a glass-styled container provided by `expo-liquid-glass-view`. It utilizes `ImageBackground` for the container's background and `ExpoLiquidGlassView` for the glass effect with customizable corner radius and style. This example highlights practical application for UI design.
```tsx
import { ExpoLiquidGlassView, LiquidGlassType, CornerStyle } from 'expo-liquid-glass-view';
import { View, Text, Image, StyleSheet, ImageBackground } from 'react-native';
export default function ComplexGlassCard() {
return (
John Doe
iOS Developer
1.2K
Followers
342
Following
89
Posts
);
}
const styles = StyleSheet.create({
background: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
profileCard: {
width: 340,
height: 280,
},
cardContent: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 24,
},
avatar: {
width: 80,
height: 80,
borderRadius: 40,
marginBottom: 16,
},
name: {
fontSize: 24,
fontWeight: 'bold',
color: '#fff',
},
role: {
fontSize: 16,
color: '#aaa',
marginTop: 4,
marginBottom: 20,
},
stats: {
flexDirection: 'row',
width: '100%',
justifyContent: 'space-around',
alignItems: 'center',
},
statItem: {
alignItems: 'center',
},
statValue: {
fontSize: 20,
fontWeight: '600',
color: '#fff',
},
statLabel: {
fontSize: 12,
color: '#888',
marginTop: 4,
},
divider: {
width: 1,
height: 40,
backgroundColor: 'rgba(255, 255, 255, 0.2)',
},
});
```
--------------------------------
### Interactive Glass Effect Button (React Native)
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
Shows how to create an interactive glass effect button using ExpoLiquidGlassView. The button responds to touch events, changing its appearance when pressed. This example utilizes various props like 'type', 'cornerRadius', 'cornerStyle', and 'isInteractive' to achieve the desired visual feedback.
```tsx
import { ExpoLiquidGlassView, LiquidGlassType, CornerStyle } from 'expo-liquid-glass-view';
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
import { useState } from 'react';
export default function InteractiveGlassExample() {
const [isPressed, setIsPressed] = useState(false);
return (
setIsPressed(true)}
onPressOut={() => setIsPressed(false)}
activeOpacity={1}
>
Interactive Button
Tap to see effect
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#0a0a0f',
},
button: {
width: 280,
height: 100,
justifyContent: 'center',
alignItems: 'center',
},
buttonPressed: {
transform: [{ scale: 0.95 }],
},
buttonText: {
fontSize: 22,
fontWeight: 'bold',
color: '#fff',
},
buttonSubtext: {
fontSize: 14,
color: '#aaa',
marginTop: 8,
},
});
```
--------------------------------
### Prebuild iOS Project with Expo
Source: https://github.com/rit3zh/expo-liquid-glass-view/blob/main/README.md
This command prebuilds your Expo project for the iOS platform. This step is necessary to integrate native modules like expo-liquid-glass-view into your project.
```bash
npx expo prebuild --platform ios
```
--------------------------------
### TypeScript Type Definitions for Expo Liquid Glass View
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
This snippet provides comprehensive TypeScript type definitions for the `expo-liquid-glass-view` library. It includes enums for `CornerStyle` and `LiquidGlassType`, and an interface `ExpoLiquidGlassViewProps` defining all possible props for the `ExpoLiquidGlassView` component. This ensures type safety and provides autocompletion for developers using the library in TypeScript projects.
```typescript
import { StyleProp, ViewStyle } from 'react-native';
import * as React from 'react';
// Corner style options
export enum CornerStyle {
Continuous = 'continuous', // Smooth, flowing curves (iOS-style)
Circular = 'circular', // Perfect circular arcs
}
// Glass effect intensity types
export enum LiquidGlassType {
Clear = 'clear', // Minimal blur, maximum transparency
Tint = 'tint', // Regular blur with custom tint color
Regular = 'regular', // Standard system blur
Interactive = 'interactive', // Interactive glass with touch response
Identity = 'identity', // Identity transformation
}
// ExpoLiquidGlassView props interface
export interface ExpoLiquidGlassViewProps {
type?: LiquidGlassType; // Glass effect type
tint?: string; // Hex color for tint type
cornerRadius?: number; // Border radius in points
isInteractive?: boolean; // Enable interactive effects
cornerStyle?: CornerStyle; // Corner curvature style
style?: StyleProp; // React Native styles
children?: React.ReactNode; // Child components
}
// Example usage with TypeScript
const glassProps: ExpoLiquidGlassViewProps = {
type: LiquidGlassType.Tint,
tint: '#FF6B6B',
cornerRadius: 24,
cornerStyle: CornerStyle.Continuous,
isInteractive: true,
style: {
width: 300,
height: 200,
},
};
```
--------------------------------
### Run Expo App on iOS Simulator/Device
Source: https://github.com/rit3zh/expo-liquid-glass-view/blob/main/README.md
This command runs your Expo application on an iOS simulator or connected device. Ensure your iOS development environment is set up correctly.
```bash
npx expo run:ios
```
--------------------------------
### Implement Glassmorphic Card with ExpoLiquidGlassView
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
Demonstrates how to use the ExpoLiquidGlassView component to create a glassmorphic card with configurable properties like type, corner radius, and corner style. This component allows embedding other React Native views within the glass effect, suitable for displaying content with a modern, translucent appearance.
```tsx
import { ExpoLiquidGlassView, CornerStyle, LiquidGlassType } from 'expo-liquid-glass-view';
import { View, Text, StyleSheet } from 'react-native';
export default function App() {
return (
Glass Effect Card
Native iOS glassmorphism
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#000',
},
glassCard: {
width: 300,
height: 200,
},
content: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 20,
},
title: {
fontSize: 24,
fontWeight: 'bold',
color: '#fff',
},
subtitle: {
fontSize: 16,
color: '#ccc',
marginTop: 8,
},
});
```
--------------------------------
### Expo Liquid Glass View Type Definitions
Source: https://github.com/rit3zh/expo-liquid-glass-view/blob/main/README.md
These TypeScript definitions outline the possible values for CornerStyle and LiquidGlassType enums, as well as the interface for ExpoLiquidGlassViewProps. These types help in understanding and utilizing the component's props correctly.
```ts
export enum CornerStyle {
Continuous = "continuous",
Circular = "circular",
}
export enum LiquidGlassType {
Clear = "clear",
Tint = "tint",
Regular = "regular",
Interactive = "interactive",
Identity = "identity",
}
export interface ExpoLiquidGlassViewProps {
type?: LiquidGlassType;
tint?: string;
cornerRadius?: number;
cornerStyle?: CornerStyle;
style?: StyleProp;
children?: React.ReactNode;
}
```
--------------------------------
### Apply Custom Tint Colors to Glass Effects (React Native)
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
Demonstrates how to apply custom color tints to glass effects using ExpoLiquidGlassView. This allows for brand-specific styling by setting the 'tint' prop with a hex color value. It requires the 'expo-liquid-glass-view' and 'react-native' libraries.
```tsx
import { ExpoLiquidGlassView, LiquidGlassType, CornerStyle } from 'expo-liquid-glass-view';
import { View, Text, StyleSheet } from 'react-native';
export default function TintedGlass() {
return (
Red Tinted Glass
Blue Tinted Glass
Green Tinted Glass
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-around',
alignItems: 'center',
backgroundColor: '#1a1a2e',
padding: 20,
},
redGlass: {
width: 280,
height: 100,
justifyContent: 'center',
alignItems: 'center',
},
blueGlass: {
width: 280,
height: 100,
justifyContent: 'center',
alignItems: 'center',
},
greenGlass: {
width: 280,
height: 100,
justifyContent: 'center',
alignItems: 'center',
},
text: {
fontSize: 20,
fontWeight: 'bold',
color: '#fff',
},
});
```
--------------------------------
### ExpoLiquidGlassContainer for Glass Layouts (React Native)
Source: https://context7.com/rit3zh/expo-liquid-glass-view/llms.txt
Demonstrates how to use the ExpoLiquidGlassContainer component to apply glassmorphism effects to a group of child views. It allows for automatic spacing control and customizable morph values. This component is useful for creating visually appealing card-like elements within a React Native application.
```tsx
import { ExpoLiquidGlassContainer } from 'expo-liquid-glass-view';
import { View, Text, StyleSheet } from 'react-native';
export default function GlassContainerExample() {
return (
Card 1
First glass card
Card 2
Second glass card
Card 3
Third glass card
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#1a1a2e',
},
glassContainer: {
padding: 20,
},
card: {
width: 300,
height: 100,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(255, 255, 255, 0.1)',
borderRadius: 12,
padding: 16,
},
cardTitle: {
fontSize: 20,
fontWeight: 'bold',
color: '#fff',
},
cardText: {
fontSize: 14,
color: '#ccc',
marginTop: 4,
},
});
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.