SwipeUI

Fade in view

UI-scroll-linked reveal measured from a separate static wrapper.

npx @swipeui/cli add fade-in-view
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Content that gently fades and rises into place as people scroll to it, like features on a landing screen.
  • Long editorial screens where each section should arrive softly.
  • Lists where a subtle entrance helps people notice new sections.

When not to use it

  • Content people need instantly, such as form fields or prices.
  • Very long lists; animating every row is distracting.
  • Elements that appear without scrolling. Use a simple entering animation.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add fade-in-view
  • Adds components/swipeui/ui/use-fade-in-view-scroll.ts, components/swipeui/ui/fade-in-view.tsx and 1 shared helper.
  • Installs react-native-reanimated, react-native-worklets. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/discover.tsx
import { FadeInView } from '@/components/swipeui/ui/fade-in-view';
import { useFadeInViewScroll } from '@/components/swipeui/ui/use-fade-in-view-scroll';

const { scrollY, onScroll, viewportRef } = useFadeInViewScroll();

<Animated.ScrollView ref={viewportRef} onScroll={onScroll} scrollEventThrottle={16}>
  <FadeInView scrollY={scrollY} viewportRef={viewportRef}>
    <Text>Discover more</Text>
  </FadeInView>
</Animated.ScrollView>;

Examples

once, repeat. The app and website share content, named boards and compact outside controls. The boards use distance={32} and threshold={0.5} for a more visible entrance across a longer scroll ramp. Full-window defaults stay unchanged.

Settings

SettingDefaultBehavior
scrollYrequiredShared scroll offset from useFadeInViewScroll.
viewportRefabsentRef returned by the scroll helper; attach it to a nested Animated.ScrollView and pass it here to measure its visible area. Omit for a full-window scroll.
childrenrequiredContent stays in layout and the accessibility tree.
threshold0.15Viewport fraction used as the reveal ramp; in (0, 1].
oncetrueKeep revealed after the first entrance.
from'bottom'Original rise, logical 'start' or 'end', or 'none' for opacity only. Logical sides mirror in RTL.
distance16Nonnegative finite travel in points.
delay0Nonnegative finite milliseconds after entry begins. Ignored when once=false, which remains scroll linked.
motionapp feelReduce Motion shows content immediately without travel.
classNameabsentRoot classes.
styleabsentNative layout escape hatch.
testIDabsentRoot and content IDs.

Accessibility

Content remains in layout and the accessibility tree. Reduce Motion shows it immediately without travel. Native screen-reader, Dynamic Type and performance checks remain pending at 7.9.

Behavior and gestures

  • Default remains the shipped bottom/16pt scroll ramp. Once freezes after full reveal; a nonzero delay gates its entrance with shared timing. Repeat stays scroll linked.
  • The application owns its content; demo controls sit outside the item.
  • Pass viewportRef from useFadeInViewScroll for a nested scroll area; window measurement remains the default.

Accessibility

  • Content stays in the layout and the accessibility tree the whole time, so screen readers can reach it before it's revealed.
  • Reduce Motion shows content immediately with no fade or travel.

Motion

  • Uses the list motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • Preserves the original scroll ramp and 16pt rise. A nonzero once-only delay gates the reveal with shared list timing.
  • Reduce Motion shows content immediately without travel; repeat remains directly scroll linked.

Performance

  • Measures from a separate static wrapper to avoid feedback loops.
  • No React re-renders while scrolling.

Notes for AI

  • Use useFadeInViewScroll() on the scroll view and pass scrollY to each FadeInView.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items