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

@bailaya/react

v1.3.1

Published

A React component library for the BailaYa public API

Readme

@bailaya/react

A React component library and hooks for the BailaYa public API

Overview

@bailaya/react builds on top of @bailaya/core to provide:

  • A BailayaProvider + useBailayaClient context
  • React hooks for fetching all core data (with loading, error, data, and refetch)
  • Components with sensible Tailwind defaults (and full styling slots)
  • Full TypeScript support, including localized text & date formatting

Works with or without Tailwind. If you don’t use Tailwind, just override the class props (or use the render props) to apply your own styling.

Features

  • Context + client (BailayaProvider + useBailayaClient)

  • Hooks (all return { data, error, loading, refetch })

    • useStudioProfile(overrideId?)
    • useUserProfile(userId)
    • useInstructors(overrideId?)
    • useClasses(from?, overrideId?)
    • useClassesByType(typeName, from?, overrideId?)
    • useEvents(from?, overrideId?)
  • Components (all props overridable)

    • <StudioProfileCard />
    • <UserProfileCard />
    • <InstructorList />
    • <ClassSchedule />
    • <ClassScheduleByType />
    • <EventSchedule />
    • <StudioDescription />

Installation

npm install @bailaya/react

or with Yarn:

yarn add @bailaya/react

Peer Dependencies

  • "react": ">=17"
  • "react-dom": ">=17"

Quick Start

First, wrap your app with BailayaProvider:

// App.tsx
import React from "react";
import { BailayaProvider } from "@bailaya/react";

export default function App() {
  return (
    <BailayaProvider config={{ studioId: "YOUR_STUDIO_ID" }}>
      {/* ...your app */}
    </BailayaProvider>
  );
}

Using a Hook

import React from "react";
import { useInstructors } from "@bailaya/react";

export function TeamSection() {
  const { data: instructors, loading, error, refetch } = useInstructors();

  if (loading) return <p>Loading...</p>;
  if (error) return <p>Error: {error.message}</p>;

  return (
    <>
      <button onClick={refetch}>Refresh</button>
      <ul>
        {instructors?.map((i) => (
          <li key={i.id}>{i.name} {i.lastname}</li>
        ))}
      </ul>
    </>
  );
}

Using a Component

import React from "react";
import { StudioProfileCard } from "@bailaya/react";

export function Dashboard() {
  return (
    <div className="max-w-md mx-auto">
      <StudioProfileCard locale="en" />
    </div>
  );
}

API Reference

<BailayaProvider config>

Provides useBailayaClient() context.

  • config.baseUrl?: string – override default API URL
  • config.studioId?: string – default studio ID

Hooks

All hooks return:

{
  data: T | null;
  error: Error | null;
  loading: boolean;
  refetch: () => Promise<void>;
}

| Hook | Description | |--------------------------------------------------|--------------------------------------------------------------| | useStudioProfile(overrideId?) | Fetch a studio’s profile. | | useUserProfile(userId) | Fetch a user’s profile / bio. | | useInstructors(overrideId?) | Fetch list of active instructors (owner, admin, instructor). | | useClasses(from?, overrideId?) | Fetch next 7 days of classes (all types). | | useClassesByType(typeName, from?, overrideId?) | Fetch next 7 days of classes filtered by typeName. | | useEvents(from?, overrideId?) | Fetch next 7 days of events. |

Components

All components share:

  • Override props for every styling slot
  • locale (where relevant)
  • labels object for custom text (e.g. instructor or business-hours labels)
  • renderItem for full JSX override

| Component | Props | |---------------------------| --------------------------------------------------------------------------------------------------------------------------------- | | <StudioProfileCard /> | overrideId?, locale?, labels?, className?, nameClassName?, descriptionClassName?, labelClassName?, renderProfile? | | <UserProfileCard /> | userId, locale?, labels?, className?, nameClassName?, bioClassName?, renderProfile? | | <InstructorList /> | overrideId?, renderItem?, plus styling slots: className?, itemClassName?, imageWrapperClassName?, etc. | | <ClassSchedule /> | from?, overrideId?, locale?, labels?, renderItem?, plus slots: className?, itemClassName?, etc. | | <ClassScheduleByType /> | typeName, from?, overrideId?, locale?, labels?, renderItem?, plus same styling slots as <ClassSchedule />. | | <EventSchedule /> | from?, overrideId?, locale?, labels?, renderItem?, plus slots: className?, itemClassName?, etc. | | <StudioDescription /> | overrideId?, locale?, render?, plus styling slots: className?, paragraphClassName? |

License

ISC