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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-highlight-component

v1.0.2

Published

Highlight React Native Components

Readme

react-native-highlight-component

react-native-highlight-component is a React Native library that allows developers to highlight specific components within their applications. This functionality is particularly useful for onboarding tutorials, feature walkthroughs, or drawing user attention to particular UI elements.

Features

  • Highlight any React Native component with an overlay.​
  • Customize the appearance of the highlight.​
  • Support for components within scrollable views.

Installation

To install the package, use either of the following commands:

Using npm:

npm install react-native-highlight-component

Using yarn:

yarn add react-native-highlight-component

Usage

Setting Up the Provider

In order for highlights to work, you must wrap your app with HighlightProvider and add HighlightOverlay within HighlightProvider at the same level as your app entry point:

<SafeAreaProvider>
	<GestureHandlerRootView  style={[flex]}>
		<SafeAreaView  style={[flex]}>
			<HighlightProvider> // <-- Add this
				<Main  /> // <-- App entry point
				<HighlightOverlay  /> // <-- Add this
			</HighlightProvider>
		</SafeAreaView>
	</GestureHandlerRootView>
</SafeAreaProvider>

Highlighting Components

Highlighting components is accomplished by using a Higher-Order Component (HoC), withHighlight. You wrap the target component as follows:

withHighlight({
  Component: ImageComponent,
  id: `image_component_${item?.id}`,
  TooltipComponent: "This is a tooltip.",
  onHighlightPress: openImage,
  topOffset: 16,
});

Handling Scrollable Views

If the highlighted component is located inside a scroll view, you must either use our ScrollWrapper or pass our scrollRef to your scroll view component and assign a function to its onScroll method to use our ScrollEmitter in the following way:

Using ScrollWrapper

import React from 'react';
import { Text, Image } from 'react-native';
import { ScrollWrapper, withHighlight } from 'react-native-highlight-component';

const App = () => {
  const HighlightedComponent = withHighlight({
    Component: Image,
    id: `example_image_component`,
    TooltipComponent: "This is an example image.",
  });
  return (
    <ScrollWrapper>
      <HighlightedComponent
        style={{width: 50, height: 50}}
        source={{
          uri: 'https://reactnative.dev/img/tiny_logo.png',
        }}
      />
    </ScrollWrapper>
  );
};

export default App;

Integrating ScrollEmitter and scrollRef with an existing ScrollView

import React from 'react';
import { ScrollView } from 'react-native';
import { ScrollEmitter, scrollRef } from 'react-native-highlight-component';
import HighlightedComponent from './HighlightedComponent';

const App = () => {
  return (
    <ScrollView
      ref={scrollRef}
      onScroll={({ nativeEvent }) => {
        ScrollEmitter.emitScroll(
          nativeEvent.contentSize,
          nativeEvent.layoutMeasurement,
          nativeEvent.contentOffset
        );
      }}
    >
      <HighlightedComponent />
    </ScrollView>
  );
};

export default App;

Using GIFs in Tooltips

To be able to use GIFs in your Tooltip Component, please follow these steps:

  1. Add this to your app/build.gradle:
dependencies {
  // your app's other dependencies
  implementation 'com.facebook.fresco:fresco:3.6.0'
}
  1. Add dependencies that suit your needs:
dependencies {
// For animated GIF support
implementation 'com.facebook.fresco:animated-gif:3.6.0'

// For WebP support, including animated WebP
implementation 'com.facebook.fresco:animated-webp:3.6.0'
implementation 'com.facebook.fresco:webpsupport:3.6.0'

// For WebP support, without animations
implementation 'com.facebook.fresco:webpsupport:3.6.0'

// Provide the Android support library (you might already have this or a similar dependency)
implementation 'com.android.support:support-core-utils:24.2.1'
}
  1. Update your MainApplication:
// ...
import com.facebook.drawee.backends.pipeline.Fresco; // <-- add this
// ...

public class MyApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    Fresco.initialize(this); // <-- add this
  }
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


For more detailed information and advanced configurations, refer to the GitHub repository.