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 🙏

© 2024 – Pkg Stats / Ryan Hefner

gk-rn-onboarding

v1.0.4

Published

A customizable onboarding screen component for React Native applications.

Downloads

11

Readme

gk-rn-onboarding Package

gk-rn-onboarding is a customizable onboarding screen component for React Native applications.

Installation

You can install the package via npm or yarn:

npm install gk-rn-onboarding

or

yarn add gk-rn-onboarding

Usage

Import the OnboardingScreen component and use it in your application.

import React, { useState } from "react";
import { View } from "react-native";
import { OnboardingScreen, Slide } from "gk-rn-onboarding";

const slides: Slide[] = [
  {
    title: "Welcome",
    subtitle: "Introduction",
    description: "This is the first slide",
    image: require("./assets/image1.png"),
    backgroundColor: "#fff",
  },
  {
    title: "Learn",
    subtitle: "Educational",
    description: "This is the second slide",
    image: require("./assets/image2.png"),
    backgroundColor: "#f7f7f7",
  },
];

const App = () => {
  const [isOnboardingOpen, setOnboardingOpen] = useState(true);

  return (
    <View style={{ flex: 1 }}>
      <OnboardingScreen
        slides={slides}
        isOpen={isOnboardingOpen}
        setIsOpen={setOnboardingOpen}
        onComplete={() => console.log("Onboarding complete")}
      />
    </View>
  );
};

export default App;

Props

OnboardingScreen

| Prop | Type | Default | Description | | --------------------- | ---------------------------------- | ------------------- | ------------------------------------------------------------------------- | | slides | Slide[] | [] | An array of slide objects defining the content of each onboarding screen. | | isOpen | boolean | false | Controls whether the onboarding screen is visible. | | setIsOpen | (isOpen: boolean) => void | | Function to set the visibility of the onboarding screen. | | onComplete | () => void | undefined | Callback function when the onboarding is completed. | | onNext | () => void | undefined | Callback function when the next button is pressed. | | onPrev | () => void | undefined | Callback function when the previous button is pressed. | | onSkip | () => void | undefined | Callback function when the skip button is pressed. | | ButtonComponent | React.ComponentType<ButtonProps> | DefaultButton | Custom button component. | | TextComponent | React.ComponentType<any> | DefaultText | Custom text component. | | TitleComponent | React.ComponentType<any> | DefaultTitle | Custom title component. | | SubtitleComponent | React.ComponentType<any> | DefaultSubtitle | Custom subtitle component. | | ImageComponent | React.ComponentType<any> | Image | Custom image component. | | buttonStyles | any | undefined | Styles for the buttons. | | textColor | string | black | Text color for the title, subtitle, and description. | | iconStyle | StyleProp<ViewStyle> | undefined | Styles for the icon. | | imageStyle | StyleProp<ImageStyle> | undefined | Styles for the image. | | contentStyle | StyleProp<ViewStyle> | undefined | Styles for the content container. | | SkipButtonComponent | React.ComponentType<ButtonProps> | DefaultSkipButton | Custom skip button component. | | skipButtonStyle | StyleProp<ViewStyle> | undefined | Styles for the skip button. | | skipIcon | React.ReactNode | undefined | Custom icon for the skip button. |

Slide

| Prop | Type | Default | Description | | ----------------- | ----------------- | ----------- | ----------------------------------- | | title | string | undefined | Title text of the slide. | | subtitle | string | undefined | Subtitle text of the slide. | | description | string | required | Description text of the slide. | | icon | React.ReactNode | undefined | Icon to be displayed on the slide. | | image | any | undefined | Image to be displayed on the slide. | | backgroundColor | string | white | Background color of the slide. |

Customization

You can customize the onboarding screen by providing your own components for buttons, text, titles, subtitles, and images. Use the corresponding props to pass your custom components.

Example

const CustomButton = ({ onPress, text }: ButtonProps) => (
  <TouchableOpacity
    onPress={onPress}
    style={{ padding: 10, backgroundColor: "blue" }}
  >
    <Text style={{ color: "white" }}>{text}</Text>
  </TouchableOpacity>
);

const App = () => {
  const [isOnboardingOpen, setOnboardingOpen] = useState(true);

  return (
    <View style={{ flex: 1 }}>
      <OnboardingScreen
        slides={slides}
        isOpen={isOnboardingOpen}
        setIsOpen={setOnboardingOpen}
        ButtonComponent={CustomButton}
        onComplete={() => console.log("Onboarding complete")}
      />
    </View>
  );
};

export default App;

License

MIT