Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Official Expo team skill for building native UI in Expo apps, fine-tuned for Opus models and usable with Claude Code or Cursor.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/gradients.md
1# CSS Gradients23> **New Architecture Only**: CSS gradients require React Native's New Architecture (Fabric). They are not available in the old architecture or Expo Go.45Use CSS gradients with the `experimental_backgroundImage` style property.67## Linear Gradients89```tsx10// Top to bottom11<View style={{12experimental_backgroundImage: 'linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%)'13}} />1415// Left to right16<View style={{17experimental_backgroundImage: 'linear-gradient(to right, #ff0000 0%, #0000ff 100%)'18}} />1920// Diagonal21<View style={{22experimental_backgroundImage: 'linear-gradient(45deg, #ff0000 0%, #00ff00 50%, #0000ff 100%)'23}} />2425// Using degrees26<View style={{27experimental_backgroundImage: 'linear-gradient(135deg, transparent 0%, black 100%)'28}} />29```3031## Radial Gradients3233```tsx34// Circle at center35<View style={{36experimental_backgroundImage: 'radial-gradient(circle at center, rgba(255, 0, 0, 1) 0%, rgba(0, 0, 255, 1) 100%)'37}} />3839// Ellipse40<View style={{41experimental_backgroundImage: 'radial-gradient(ellipse at center, #fff 0%, #000 100%)'42}} />4344// Positioned45<View style={{46experimental_backgroundImage: 'radial-gradient(circle at top left, #ff0000 0%, transparent 70%)'47}} />48```4950## Multiple Gradients5152Stack multiple gradients by comma-separating them:5354```tsx55<View style={{56experimental_backgroundImage: `57linear-gradient(to bottom, transparent 0%, black 100%),58radial-gradient(circle at top right, rgba(255, 0, 0, 0.5) 0%, transparent 50%)59`60}} />61```6263## Common Patterns6465### Overlay on Image6667```tsx68<View style={{ position: 'relative' }}>69<Image source={{ uri: '...' }} style={{ width: '100%', height: 200 }} />70<View style={{71position: 'absolute',72inset: 0,73experimental_backgroundImage: 'linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%)'74}} />75</View>76```7778### Frosted Glass Effect7980```tsx81<View style={{82experimental_backgroundImage: 'linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%)',83backdropFilter: 'blur(10px)',84}} />85```8687### Button Gradient8889```tsx90<Pressable style={{91experimental_backgroundImage: 'linear-gradient(to bottom, #4CAF50 0%, #388E3C 100%)',92padding: 16,93borderRadius: 8,94}}>95<Text style={{ color: 'white', textAlign: 'center' }}>Submit</Text>96</Pressable>97```9899## Important Notes100101- Do NOT use `expo-linear-gradient` — use CSS gradients instead102- Gradients are strings, not objects103- Use `rgba()` for transparency, or `transparent` keyword104- Color stops use percentages (0%, 50%, 100%)105- Direction keywords: `to top`, `to bottom`, `to left`, `to right`, `to top left`, etc.106- Degree values: `45deg`, `90deg`, `135deg`, etc.107