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

@hapio/hapio-booking-flow-react

v1.0.5

Published

A booking component for the Hapio API

Downloads

29

Readme

Hapio Booking Flow for React

A component built for the Hapio API that can be installed as an npm package. Users can pass a configuration JSON object to the flow component after importing the package to customize settings

Features

  • Easy Booking: Streamlined booking process.
  • Get started fast: Works out of the box with just an Hapio Api Token, no other setup needed.
  • Hapio API Integration: Manage resources, schedules, and bookings with Hapio's lightning quick API.
  • Customizable: Override the default configuration with your own settings, texts and theme configurations.

Requirements

  • React 18 or 19
  • ReactDOM 18 or 19
  • Hapio State Manager

Installation

Install the package with your favourite package manager

npm install @hapio/hapio-booking-flow-react
yarn add @hapio/hapio-booking-flow-react

Usage

Import the Flow component in your project and pass hapioApiToken and your custom configuration if needed.

// Example usage in a React app
import React from 'react';
import { Flow } from '@hapio/hapio-booking-flow-react';

const userConfig = {
  "hapioApiToken": "HAPIO_API_TOKEN",
  ... Optional config settings ...
};

function App() {
  return <Flow config={userConfig} />;
}

export default App;

Configuration and Settings

Hapio Booking Flow comes with a default config for all settings, all of these settings can be changed by passing a JSON object to the Flow component.

Default config

{
    "hapioApiToken": "",
    "hapioBaseURL": "https://eu-central-1.hapio.net/v1",
    "settings": {
        "locale": "en-GB",
        "storeExpireTime": 84000000,
        "afterBookingExipreTime": 300000,
        "metaDataFields": {
            "name": {
                "required": true,
                "type": "text",
                "size": "full",
                "label": "Name",
                "placeholder": "Name"
            },
            "email": {
                "required": true,
                "type": "email",
                "size": "half",
                "label": "Email",
                "placeholder": "Email"
            },
            "phone": {
                "required": true,
                "type": "tel",
                "size": "half",
                "label": "Phone",
                "placeholder": "Phone"
            }
        }
    },
    "theme": {
        "palette": {
            "primary": "#F6C800",
            "secondary": "#B1BCFD",
            "text": "#F5EAFF",
            "dark": "#28213D",
            "light": "#6B7280",
            "disabled": "#374151",
            "background": "#0F042E",
            "error": "#F6C800"
        },
        "fonts": {
            "families": {
                "primary": "'Space Grotesk', cursive",
                "secondary": "'Helvetica Neue', sans"
            },
            "sizes": {
                "h1": "2.5rem",
                "h2": "2rem",
                "h3": "1.75rem",
                "h4": "1.5rem",
                "h5": "1.25rem",
                "h6": "1rem",
                "body1": "1rem",
                "body2": "0.875rem"
            }
        }
    },
    "content": {
        "backButton": "Back",
        "stepText": "Step",
        "locationTitle": "Location",
        "serviceTitle": "Service",
        "resourceTitle": "Resource",
        "dateTitle": "Date",
        "timeSlotTitle": "Time",
        "metaDataFormTitle": "Your details",
        "metaDataLocationLabel": "Location",
        "metaDataServiceLabel": "Service",
        "metaDataResourceLabel": "Resource",
        "metaDataDateLabel": "Date",
        "metaDataTimeLabel": " Time",
        "metaDataFieldsLabel": "Your details",
        "metaDataSubmitButton": "Confirm booking",
        "completedTitle": "Booking Confirmed",
        "completedMessage": "Thank you for your booking! A confirmation email with all the details has been sent to your inbox."
    }
}

Settings explanation

locale

date-fns locale string List of available languages can be found here

"locale": string,

storeExpireTime

Life span of local storage

"storeExpireTime": integer,

afterBookingExpireTime

Life span of local storage after a booking is completed

"afterBookingExpireTime": integer,

metaDataFields

Metadata fields for "Details" view

{
  // Unique field key, will also be used as the key in the API request.
  "uniqueKey": {
    // Field required property: true or false
    "required": boolean,

    // Field type, ex: 'text', 'email', 'tel', 'textarea'
    "type": string,

    // Field width: 'full', 'half', or 'third'
    "size": string,

    // Field label and placeholder texts
    "label": string,
    "placeholder": string
  },

  // Add any number of fields here
}

FAQ

Q: Is Hapio free to use? A: Hapio does have a free plan with no card details required! Read more about our pricing here.

Q: If I run into trouble, can I get help? A: Absolutely! Feel free to reach out to us at [email protected], and we’ll do our best to assist you.

Resources

Contribution

Contributions are welcome!

Please open an issue or submit a pull request for improvements or bug fixes. Security fixes will be recognized in our Hapio Hall of Fame.