Skip to content

gdbroman/react-promenade

Repository files navigation

React Promenade – React components for crafting multi-step user flows

Headless React components for crafting multi-step user flows

Gus Twitter follower count react-promenade repo star count

Installation · Documentation · Author


Introduction

React Promenade is an unstyled component library that makes it easy to create multi-step user flows with step-by-step validation and navigation.

Why Multi-Step User Flows?

Breaking big forms into multi-step user flows will almost always:

  • improve UX
  • increase user engagement
  • boost signups & completion rates

Installation

npm i react-promenade
# or
pnpm add react-promenade
# or
yarn add react-promenade
# or
bun add react-promenade

Example

import { PromenadeProvider, PromenadeStep, usePromenade } from 'react-promenade';

function Signup() {
  return (
    <PromenadeProvider
      stepCount={3}
      isBackDisabled={(index) => { return index === 0 }}
      isNextDisabled={(index) => { return false }}
      isBackLoading={(index) => { return false }}
      isNextLoading={(index) => { return false }}
      onBack={(index) => { console.log('back clicked on step', index) }}
      onNext={(index) => { console.log('next clicked on step', index) }}
    >
      <PromenadeStep index={0}><EmailStep /></PromenadeStep>
      <PromenadeStep index={1}><AvatarStep /></PromenadeStep>
      <PromenadeStep index={2}><AboutMeStep /></PromenadeStep>
    </PromenadeProvider>
  )
}

function EmailStep() {
  const { isBackDisabled, isNextDisabled, goBack, goForward } = usePromenade()

  return (
    <div>
      <h1>Step 1</h1>
      <button onClick={goBack} disabled={isBackDisabled}>Back</button>
      <button onClick={goForward} disabled={isNextDisabled}>Next</button>
    </div>
  )
}

View full documentation and examples under ./docs.

Author

  • Gus @gdbroman (reach out for questions or feedback)

About

An unstyled library for multi-step user flows in React

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy