Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More β†’
Socket
Book a DemoInstallSign in
Socket

rn-fade-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-fade-wrapper

πŸ”₯ Fade gradient wrapper for React Native scrollable views and overlays on iOS and Android.

latest
Source
npmnpm
Version
0.1.10
Version published
Maintainers
1
Created
Source

React Native fade gradient wrapper

React Native fade gradient wrapper demo

rn-fade-wrapper is a simple, highly-performant React Native component that adds smooth, customizable fade gradients to the edges of any content. Perfect for enhancing the user experience in scrollable containers, lists, carousels, modals, or any view with overflowing content.

npm version iOS Android TypeScript MIT License Bundle size

✨ Features

  • ⚑ Native rendering for iOS and Android
  • πŸ” Supports vertical and horizontal gradient directions
  • 🎨 Fully customizable fade size and color (per side or uniform)
  • ↕️ Optional inward mode to fade towards content instead of outward
  • 🧩 Simple API: drop-in wrapper with intuitive props
  • πŸ’ͺ Great performance with low overhead β€” ideal for scroll views and animations

πŸ“¦ Installation

yarn add rn-fade-wrapper

or

npm install rn-fade-wrapper

Expo

This library works in Expo (with expo prebuild) without additional configuration.

πŸ“± Platform Support

PlatformOld ArchFabric
iOSβœ…βœ…
Androidβœ…βœ…

πŸš€ Quick Start

import { FadeWrapper } from 'rn-fade-wrapper';

const MyComponent = () => {
  return (
    <FadeWrapper
      color="#ffffff"
      size={24}
      orientation="vertical"
    >
      <ScrollView>
        <Text>Fading edges example</Text>
      </ScrollView>
    </FadeWrapper>
  );
};

🧩 Props

PropTypeDefaultDescription
colorstring"#ffffff"Fade color (can be any valid color string)
sizenumber20Uniform fade size in points
styleViewStyle{Β zIndex:Β 2Β }Custom style applied to the wrapper view
inwardbooleanfalseMakes the gradient fade inward (towards the center) instead of outward
sizes{ top?: number, right?: number, bottom?: number, left?: number }undefinedSpecific fade sizes per edge (overrides size and orientation)
orientation'horizontal' | 'vertical''vertical'Preset for direction: applies size to top/bottom or left/right
childrenReact.ReactNodeβ€”Your wrapped content

Note: sizes takes precedence over both size and orientation.

πŸŽ› Examples

🎯 Custom sides + inward fade:

<FadeWrapper
  color="black"
  inward
  sizes={{ top: 20, bottom: 30 }}
>
  <FlatList ... />
</FadeWrapper>

πŸ“œ Horizontal scroll fade:

<FadeWrapper
  color="rgba(0,0,0,0.5)"
  size={16}
  orientation="horizontal"
>
  <ScrollView horizontal>
    {/* content */}
  </ScrollView>
</FadeWrapper>

πŸ›  Under the Hood

  • iOS: Uses CAGradientLayer inside native UIView
  • Android: Draws LinearGradient on custom ViewGroup using Canvas
  • Handles layout and re-renders with platform-specific logic for consistency

πŸ’‘ UX Tip

Use rn-fade-wrapper to subtly indicate content overflow β€” especially in carousels, scroll views, and horizontal sliders. Gradients help hint to the user that there's more to scroll, improving engagement.

πŸ“˜ License

MIT β€” free to use, improve and contribute πŸŽ‰

Keywords

react-native

FAQs

Package last updated on 28 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts