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 🙏

© 2024 – Pkg Stats / Ryan Hefner

simple-seat-picker

v0.0.7

Published

A React component to pick seats in a cinema or a theater

Downloads

3

Readme

Simple Seat Picker

[!IMPORTANT] This library is still in development. Some features may change, and full stability is not guaranteed until a complete version is released. Please use it with caution and contribute by reporting any issues or suggestions.

SeatPicker is a React library that provides an easy-to-use and customizable seat selection system, perfect for ticket booking applications such as cinemas, concerts, or stadiums. The library allows you to create adaptable seat maps with support for custom layouts, seat states, and dynamic selection management.

see the StoryBook with the examples and documentation.

🪨 Features

  • Customizable Seat Map: Create seat maps with flexible layouts tailored to your event's specific needs.
  • Dynamic Seat States: Manage seats with states like occupied, selected, and free.
  • Global State Management: Utilize React context to easily manage and access selected seats across your application.
  • Responsive Design: Designed to adapt seamlessly to different screen sizes and contexts, including modals and full-screen views.

🚀 Installation

Install the library via npm:

pnpm add simple-seat-picker

📚 Usage

The Storybook is aviable here with the examples and documentation.

Import all the components and the default styles.

import { createMatrix3x3, SeatMap, SeatMapProvider } from "simple-seat-picker"
import "simple-seat-picker/dist/style.css"

Then create the data matrix with the utility function, you can define reserved seats.

  const data = createMatrix3x3({ row: 1, column: 1 });
  const reserved = ["B28", "B29", "B30"]

Inside the SeatMapProvider pass all the data to SeatMap component.

<SeatMapProvider>
  <SeatMap
    size={data.size}
    cells={data.cells}
    reserved={reserved}
  />
</SeatMapProvider>

All example code just looks like.

import { createMatrix3x3, SeatMap, SeatMapProvider } from "simple-seat-picker"
import "simple-seat-picker/dist/style.css"

function App() {
  const data = createMatrix3x3({ row: 1, column: 1 });
  const reserved = ["B28", "B29", "B30"]


  return (
    <div>
      <SeatMapProvider>
        <SeatMap
          size={data.size}
          cells={data.cells}
          reserved={reserved}
        />
      </SeatMapProvider>
    </div>
  )
}

export default App

🤝 Contributing

We welcome contributions to improve and expand this library! If you're interested in contributing, please follow these steps:

  1. Fork the Repository: Click the "Fork" button at the top of this repository to create your own copy.

  2. Clone Your Fork: Clone your forked repository to your local machine.

    git clone https://github.com/your-username/seatpicker.git
  3. Create a Branch: Create a new branch for your feature or bugfix.

    git checkout -b your-feature-branch
  4. Install Dependencies: Make sure all dependencies are installed by running:

    pnpm install
  5. Make Your Changes: Implement your feature or bugfix.

  6. Test Your Changes: Ensure that your changes work correctly by running the tests and checking the components in the development environment.

  7. Commit Your Changes: Commit your changes with a clear and descriptive message.

    git commit -m "Add feature/fix bug: [description of the feature or bug]"
  8. Push Your Changes: Push your branch to your forked repository.

    git push origin your-feature-branch
  9. Create a Pull Request: Go to the original repository and create a pull request from your fork. Describe your changes in detail and any issues it addresses.

  10. Review Process: Your pull request will be reviewed by the maintainers. Please be patient and responsive to any feedback or requests for changes.

Thank you for contributing! Every bit of help is appreciated in making this library better.

🧻 LICENCE

This project is licensed under the MIT License. See the LICENSE file for more details.