Web Analytics

rn-fade-wrapper

⭐ 75 stars English by pioner92

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

---

📦 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

| Platform | Old Arch | Fabric | |----------|----------|--------| | iOS | ✅ | ✅ | | Android | ✅ | ✅ |


🚀 Quick Start

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

const MyComponent = () => { return ( Fading edges example ); };


🧩 Props

| Prop | Type | Default | Description | |--------------|----------------------------|----------------------|-------------| | color | string | "#ffffff" | Fade color (can be any valid color string) | | size | number | 20 | Uniform fade size in points | | style | ViewStyle | { zIndex: 2 } | Custom style applied to the wrapper view | | inward | boolean | false | Makes the gradient fade inward (towards the center) instead of outward | | sizes | { top?: number, right?: number, bottom?: number, left?: number } | undefined | Specific fade sizes per edge (overrides size and orientation) | | orientation| 'horizontal' \| 'vertical' | 'vertical' | Preset for direction: applies size to top/bottom or left/right | | children | React.ReactNode | — | Your wrapped content |

Note: sizes takes precedence over both size and orientation.


🎛 Examples

🎯 Custom sides + inward fade:


  

📜 Horizontal scroll fade:


  
    {/ content /}
  


🛠 Under the Hood

---

💡 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 🎉

--- Tranlated By Open Ai Tx | Last indexed: 2025-12-08 ---