Rain

Rain is one of the 16 effects of dissolve, an animation library for React Native. Grains fall and settle, bottom row first. It runs with DissolveIn from dissolve-ui.

Usage

Rain (React Native)
import { DissolveIn } from 'dissolve-ui';

<DissolveIn
  preset="rain"
  grain={3}
  duration={1200}
>
  <Card />
</DissolveIn>

Options

OptionTypeDefaultDescription
presetVariantName'gather'Set it to 'rain'. Any exit preset also works as an entrance.
grainnumber3Grain size in points. Raised automatically past about 6000 grains per burst.
durationnumber1200Full effect length in ms. Entrances default to 1200.
origin'left' | 'right' | 'top' | 'bottom' | 'center' | { x, y }noneWhere the view starts to assemble. Without it the variant uses its own order.
delaynumber0Wait before starting, in ms. Use index * 40 to stagger a list.
playbooleantrueDissolveIn only. Plays on mount; flip it from false to true to play later.
onAppear() => voidnoneDissolveIn only. Called once the real view is visible.
hapticsbooleanfalseEntrances are quiet by default, lists can stagger many of them.
field'cascade'noneReplaces the native delay with a diagonal wave, for lists and full screens.

Best practices

  • Use it for content that loads in: refreshed feeds, search results, a grid of products.
  • Stagger rows with delay={index * 40} for a falling wave.
  • Avoid it for views at the very top of the screen, grains fall from above the view.
  • 1000 to 1400 ms keeps the settle bounce crisp.
  • With reduced motion the view simply appears.

Install

Install the package and its peers, then wrap the app once in <DissolveProvider>, above the navigator.

npx expo install dissolve-ui @shopify/react-native-skia react-native-reanimated react-native-worklets react-native-gesture-handler expo-haptics
app/_layout.tsx
import { Stack } from 'expo-router';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { DissolveProvider } from 'dissolve-ui';

export default function Layout() {
  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <DissolveProvider>
        <Stack />
      </DissolveProvider>
    </GestureHandlerRootView>
  );
}

Previous: Gather · Next: Print · All effects

dissolve is MIT licensed. Source on GitHub, package on npm. This page as markdown. For AI agents: llms.txt.