npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

expo-gradient-text

v1.0.8

Published

A beautiful and customizable gradient text component for React Native Expo applications

Readme

GradientText Component

A beautiful and customizable gradient text component for React Native Expo applications. Create awesome text effects with smooth color gradients in any direction.

Gradient Text Preview

✨ Features

  • 🎨 Customizable Colors - Use any gradient color combination
  • 📐 Direction Control - Horizontal, vertical, or diagonal gradients
  • 🎯 Easy Integration - Drop-in replacement for React Native Text
  • 🔧 Flexible Styling - Supports all Text component styles
  • 📱 Expo Compatible - Works seamlessly with Expo managed workflow
  • Performance Optimized - Efficient rendering using MaskedView

📦 Installation

Install the package and required peer dependencies:

npm install expo-gradient-text
npx expo install expo-linear-gradient @react-native-masked-view/masked-view

🚀 Quick Start

import React from 'react';
import { View } from 'react-native';
import GradientText from 'expo-gradient-text';

export default function App() {
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <GradientText style={{ fontSize: 32, fontWeight: 'bold' }}>
        Hello Gradient!
      </GradientText>
    </View>
  );
}

📖 API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | children | string \| React.ReactNode | Required | The text content to display | | colors | string[] | ['#FF6B6B', '#4ECDC4'] | Array of colors for the gradient | | start | {x: number, y: number} | {x: 0, y: 0} | Starting point of the gradient | | end | {x: number, y: number} | {x: 1, y: 0} | Ending point of the gradient | | style | TextStyle | {} | Style object for the text | | ...textProps | TextProps | - | All other React Native Text props |

Gradient Direction Guide

// Horizontal (left to right)
start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}

// Vertical (top to bottom)  
start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }}

// Diagonal (top-left to bottom-right)
start={{ x: 0, y: 0 }} end={{ x: 1, y: 1 }}

// Diagonal (top-right to bottom-left)
start={{ x: 1, y: 0 }} end={{ x: 0, y: 1 }}

🎨 Usage Examples

Basic Gradient

<GradientText style={{ fontSize: 24, fontWeight: 'bold' }}>
  Welcome!
</GradientText>

Previews

Previews

iOS | Android :-------------------------:|:-------------------------: |

Custom Colors

<GradientText 
  colors={['#667eea', '#764ba2']}
  style={{ fontSize: 28, fontWeight: '600' }}
>
  Custom Gradient
</GradientText>

Vertical Gradient

<GradientText 
  colors={['#ff9a9e', '#fecfef']}
  start={{ x: 0, y: 0 }}
  end={{ x: 0, y: 1 }}
  style={{ fontSize: 32, fontWeight: 'bold' }}
>
  Vertical Flow
</GradientText>

Rainbow Effect

<GradientText 
  colors={['#ff0000', '#ff8000', '#ffff00', '#80ff00', '#00ff80', '#0080ff', '#8000ff']}
  style={{ fontSize: 26, fontWeight: 'bold' }}
>
  Rainbow Magic
</GradientText>

Sunset Theme

<GradientText 
  colors={['#ff7e5f', '#feb47b']}
  start={{ x: 0, y: 0 }}
  end={{ x: 1, y: 1 }}
  style={{ fontSize: 30, fontWeight: 'bold' }}
>
  Sunset Vibes
</GradientText>

🎨 Popular Color Combinations

// Ocean Breeze
colors={['#667eea', '#764ba2']}

// Warm Sunset  
colors={['#ff7e5f', '#feb47b']}

// Cool Blues
colors={['#74b9ff', '#0984e3']}

// Purple Dream
colors={['#a29bfe', '#6c5ce7']}

// Green Nature
colors={['#55efc4', '#00b894']}

// Fire Gradient
colors={['#fd79a8', '#fdcb6e', '#e17055']}

// Night Sky
colors={['#2d3436', '#636e72', '#b2bec3']}

🏗️ Component Structure

The component uses a combination of MaskedView and LinearGradient to achieve the gradient text effect:

  1. MaskedView - Creates a mask using the text shape
  2. LinearGradient - Provides the gradient background
  3. Text - Invisible text that defines the mask boundaries

🔧 TypeScript Support

interface GradientTextProps extends TextProps {
  children: React.ReactNode;
  colors?: string[];
  start?: { x: number; y: number };
  end?: { x: number; y: number };
  style?: StyleProp<TextStyle>;
}

📱 Platform Compatibility

  • ✅ iOS
  • ✅ Android
  • ✅ Expo Go
  • ✅ Expo Dev Build

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ for the React Native community