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

@pureboard/react-native-pure-funnel

v1.1.0

Published

easy handling funnel in react native

Readme

react-native-pure-funnel

easy handling funnel in react native.

This library was inspired by Toss's useFunnel and is designed for use in React Native.

ref. toss slash useFunnel, useFunnel youtube

react-native-pure-funnel

Installation

npm install @pureboard/react-native-pure-funnel
yarn add @pureboard/react-native-pure-funnel

Usage

how to use react-native-pure-funnel

  1. Wrap the component where you want to apply the funnel with the withFunnel HOC.
  2. Place FunnelStep components within the Funnel component to set up the desired funnel.
  3. Import useFunnel and initialize it by passing steps and options (optional) as parameters.
  4. You can handle funnel transitions using funnelNavigation.
  5. Configure the Android back button and the react-navigation header appropriately (using funnelNavigation.goBack).
  6. Each funnel step has the default dimensions of the viewport’s screenWidth and screenHeight.
  7. For more details, refer to the usage code below or the example app in the repository.
import {
  Funnel,
  FunnelStep,
  withFunnel,
  useFunnel
} from '@pureboard/react-native-pure-funnel';
import {
  useNavigation,
} from '@react-navigation/native';

const steps = ['A', 'B', 'C'] as const;

// you must wrap your component with `withFunnel` HOC
export const FunnelScreen = withFunnel(() => {
  const navigation = useNavigation();

  const { funnelNavigation } = useFunnel(steps, {
    goBackAction: navigation.goBack,
  });

  return (
    <Funnel<typeof steps>>
      <FunnelStep name={'A'}>
        {/* A funnel content*/}
        <View>
           <Button label={'go to B funnel'} onPress={()=>funnelNavigation.goForward()}/>
        </View>
      </FunnelStep>
      <FunnelStep name={'B'}>
        {/* B funnel content*/}
      </FunnelStep>
      <FunnelStep name={'C'}>
        {/* C funnel content*/}
      </FunnelStep>
    </Funnel>
  );
});

types

Steps

Steps represents the stages in a funnel, passed as a generic when using useFunnel. It must extend NonEmptyArray.

FunnelOptions

initialStep(ArrayElement<Steps>): The step or steps to start the funnel from. goBackAction(()=>void): This is executed when the length of the funnelStack is 1 or less, and no more funnels can be popped.

FunnelNavigationOptions

animated(boolean): Whether the transition should be animated

API Reference

useFunnel

Initializes the funnel with the specified steps. and returns funnel handling interfaces. (The Funnel is not rendered on the screen until the initialization code is called.)

params

steps(Steps): An array of steps that represent the funnel stages. options(optional)?: FunnelOptions

returns

funnelSteps: (Steps | null)

The list of funnel steps.

funnelStack: ArrayElement<Steps>[] | null

The current stack of visited funnel steps.

funnelOptions: FunnelOptions<ArrayElement<Steps>>

The current funnel options.

funnelNavigation

The funnelNavigation object contains methods for controlling the funnel navigation flow:

  • goBack (navigateOptions?: FunnelNavigationOptions)=>void: Navigate back to the previous step.

  • goForward (navigateOptions?: FunnelNavigationOptions)=>: Move to the next step.

  • reset (stack?: Steps[], navigateOptions?: FunnelNavigationOptions)=>void: You can customize the funnelStack to the desired form. If no stack is passed, it will reset to the default initial value.

  • navigate (step: Step, navigateOptions?: FunnelNavigationOptions)=>void: Navigate to a specific step.

  • replace (step: Step, navigateOptions?: FunnelNavigationOptions): Replace the current step with a new one.

  • setOptions (options: Partial<FunnelOptions<Steps>>): Update funnel options dynamically.

Funnel Component

The Funnel component is used to manage step-based navigation flows, allowing users to navigate through predefined steps in a funnel. This component provides additional configuration options for handling gestures and screen dimensions, particularly on iOS devices.

gestureEnabled (iOS only)

Type: boolean Default: true Description: Determines whether it's possible to trigger funnel back navigation using swipe gestures. This is an iOS-only feature. Usage: When set to true, users can swipe to go back within the funnel if a previous step exists. If set to false, swipe gestures will be disabled.

FunnelStep Component

The FunnelStep component represents an individual step within a funnel flow. Each step is defined with a name and can trigger specific lifecycle events when mounted or focused. This component is used as a child of the Funnel component to manage and structure different steps in the funnel.

name

Type: ArrayElement Description: The unique name of the step. This should correspond to one of the steps defined when initializing the funnel with useFunnel. Usage: Each FunnelStep must have a unique name to distinguish it from other steps in the funnel.

onMount (optional)

Type: () => void Description: A function that will be called once when the step is mounted. This can be used to execute any side effects or data fetching when the step first appears in the funnel. Usage: You can define any logic that should occur when the step is initially rendered.

onFocused (optional)

Type: () => void Description: A function that will be called every time the step becomes focused. This can be used to trigger logic when the user navigates to this step within the funnel. Usage: Define logic that should occur every time the step is focused.

Contributing

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

License

MIT


Made with create-react-native-library