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

@yuefengzhang/slotbooking

v1.0.4

Published

A React time slot booking component library with a calendar picker and scheduler

Readme

@yuefengzhang/slotbooking

A modern React time slot booking component library with calendar picker and scheduler. Built with Material-UI and Emotion.

Features

  • 📅 Modern calendar picker with dark theme support
  • ⏰ Flexible time slot selection
  • 🎨 Fully customizable themes
  • 📱 Responsive design
  • 🔄 Built-in availability management
  • 💪 TypeScript support

Installation

First, install the package:

npm install @yuefengzhang/slotbooking

This library uses Material-UI and other dependencies. If you don't have them in your project yet, install the required peer dependencies:

npm install @mui/material @mui/x-date-pickers @mui/icons-material @mui/system @emotion/react @emotion/styled date-fns

If you already have some of these dependencies in your project, you don't need to install them again. The library is compatible with the following versions:

{
  "@emotion/react": "^11.0.0",
  "@emotion/styled": "^11.0.0",
  "@mui/material": "^5.0.0",
  "@mui/x-date-pickers": "^6.0.0",
  "@mui/icons-material": "^5.0.0",
  "@mui/system": "^5.0.0",
  "date-fns": "^2.30.0"
}

Note: The library requires react and react-dom version 18 or higher.

Usage

TimeScheduler

import { TimeScheduler, TimeSchedulerProvider } from '@yuefengzhang/slotbooking';

const scheduleData = [
  {
    date: '2024-03-18',
    operatingHours: {
      start: '09:00',
      end: '17:00'
    },
    unavailableRanges: [
      { start: '12:00', end: '13:00' } // Lunch break
    ],
    bookings: [
      { start: '14:00', end: '15:00' } // Existing booking
    ]
  }
];

function App() {
  return (
    <TimeSchedulerProvider initialScheduleData={scheduleData}>
      <TimeScheduler />
    </TimeSchedulerProvider>
  );
}

CalendarPicker

import { CalendarPicker, darkTheme } from '@yuefengzhang/slotbooking';

function App() {
  const [isOpen, setIsOpen] = useState(false);
  const [selectedDate, setSelectedDate] = useState<Date | null>(null);

  return (
    <CalendarPicker
      isOpen={isOpen}
      onClose={() => setIsOpen(false)}
      onSelect={setSelectedDate}
      theme={darkTheme}
      availableDates={availableDates}
      minDate={minDate}
      maxDate={maxDate}
    />
  );
}

API Reference

TimeSchedulerProvider Props

| Prop | Type | Description | |------|------|-------------| | initialScheduleData | DaySchedule[] | Schedule configuration with available slots and bookings | | children | ReactNode | Child components |

CalendarPicker Props

| Prop | Type | Description | |------|------|-------------| | isOpen | boolean | Controls calendar visibility | | onClose | () => void | Called when calendar is closed | | onSelect | (date: Date) => void | Called when date is selected | | theme | Theme | Theme configuration | | availableDates | Date[] | Array of available dates | | minDate | Date | Minimum selectable date | | maxDate | Date | Maximum selectable date |

Customization

Theme Structure

const theme = {
  colors: {
    primary: '#00C853',
    primaryLight: '#4CD787',
    primaryDark: '#27AE60',
    secondary: '#757575',
    text: '#FFFFFF',
    disabled: '#666666',
    weekend: '#BBBBBB',
    background: '#424242',
    headerBackground: '#00C853',
    selectedBackground: '#00C853',
    hoveredBackground: '#00E676'
  },
  borderRadius: '4px',
  fontSize: {
    small: '12px',
    medium: '14px',
    large: '16px'
  },
  typography: {
    fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
    calendar: {
      fontSize: '14px',
      fontWeight: '400'
    }
  }
};

License

MIT © Yuefeng Zhang