9:41
Installation
One command copies the source into your app — you own the code and can change anything.
After you add the file, import it like any local component:
App.tsx
import { GrainGradient } from "@/components/ui/grain";Or add it with the CLI (installs any missing peers):
Usage
Colours, radius and light / dark come from
useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| palette Built-in colour set. | sunset | ocean | aurora | dusk | peach | graphite | ember | mint | lavender | candy | forest | noir | "sunset" |
| colors Base colour first, then up to four blob colours. Overrides palette. | string[] | — |
| grain Grain strength, 0–1. | number | 0.55 |
| seed Shuffles where the blobs sit. | number | 0 |
| style Root style; give it a size or flex: 1. | StyleProp<ViewStyle> | — |
| className Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. | string | — |
| GrainOverlay grain Grain only, laid over its parent. | number | 0.55 |
Behaviour & accessibility
- Gradient
- A base colour with up to four radial blobs, drawn with react-native-svg so it scales to any size.
- Grain
- A tiny tiling noise image drawn at 2×, so the speckle stays fine on every screen; grain sets its strength.
- Touch
- The gradient and grain never take touches; children render on top.
Source
FAQ
How do I make a grain gradient in React Native?
Use ExpoKit's Grain Gradient: run
npx @expokit/cli@latest add grain in your Expo or React Native project and it copies a ready-made grain gradient into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.Does Grain Gradient work in Expo Go?
Yes. Grain Gradient runs in Expo Go on iOS and Android with no development build — its packages (
react-native-svg) are all included in Expo Go.How do I add Grain Gradient to my Expo app?
Run
npx @expokit/cli@latest add grain in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.Is Grain Gradient free?
Yes. Grain Gradient is free: its full source is on this page and the CLI installs it without an account.