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

@shubhamkumarbaranwals/react-native-gradient-border

v1.0.0

Published

Forked and fixed version of react-native-gradient-border

Readme

🤯 Actual Gradient Borders in React Native 🤯

banner

Features

  • Easily create views with gradient borders
  • Supports any background (including transparent)
  • Uses same style properties as <View/>
    • borderWidth, borderRadius, borderLeftWidth, borderTopRightRadius etc.
  • Exposes react-native-linear-gradient props to allow full customization of gradient
  • Great typesafety to prevent potential usage issues

API Reference

Not Maintained

This library is not being actively maintained.

Installation

Install package and peer dependencies:

yarn add @good-react-native/gradient-border @react-native-masked-view/masked-view react-native-linear-gradient

Then install pods (iOS):

cd ios && pod install

Usage

<GradientBorderView> works just like a regular view, except it has an additional required prop called gradientProps, which are the props that will get passed to the <LinearGradient/>:

<GradientBorderView
    gradientProps={{
        colors: ['red', 'orange']
    }}
    style={{
        borderWidth: 5,
        borderRadius: 5,
        height: 50,
        width: 50,
    }}
/>

Screen Shot 2022-08-28 at 10 34 13 AM

Note we just use the views border styles to control things like border width, border radius, etc. All border styles are supported (borderTopWidth, borderBottomLeftRadius, etc).

If you don't pass a border width there will be no gradient border shown.

colors is the only required property to pass to gradientProps, but there are other props for customizing the gradient. If you want more information on how to modify the gradient itself, check out the docs. (it's good).

Differences with <View/>

Absolute positioning

One difference between the <GradientBorderView/> and a regular <View/> border is that when applying a border to a regular view, any absolute positioned child components will take into account the border width. It doesn't seem like there's any way to mimic this behavior in our <GradientBorderView/>. One solution is to wrap the inner view with an extra <View/>:

<GradientBorderView
    gradientProps={{
        colors: ['red', 'orange']
    }}
    style={{
        borderWidth: 5,
        borderRadius: 5,
        height: 50,
        width: 50,
    }}
>
    <View
        style={{width: '100%', height: '100%',}}
    >
        <View 
            style={{
                position: 'absolute',
                right: 0,
                top: 0,
                width: 5, 
                height: 5,
                color: 'blue',
            }}
        />
    </View>
</GradientBorderView>

Percentage padding

<GradientBorderView/> applies its own padding internally to compensate for the border width. Since that padding is combined with the developers padding, we can't support percentage based padding.

API Reference

GradientBorderView Props

<GradientBorderView/> support all props that React Native's view supports, but uses a modified version of the style prop. Specifically, the modified style prop does not accept any of the borderColor props, and only accepts number padding values.

Additionally, it has the following props: | Props | Description | Type | Required | |---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|--------------| | gradientProps | Props to be passed to the <LinearGradient/> from react-native-linear-gradient. Requires at least a colors property. Supports all LinearGradient props except style and pointerEvents. | GradientProps | Yes |