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

koi-pool

v0.0.30

Published

Koi Pool is a React-based components library that offers a flexible and easy-to-use set of components for creating and managing a variety of components in React applications. With full TypeScript support, it provides type-safe props and an intuitive API t

Downloads

350

Readme

Koi Pool - React Components Library

Koi Pool is a React-based components library that offers a flexible and easy-to-use set of components for creating and managing a variety of components in React applications. With full TypeScript support, it provides type-safe props and an intuitive API to enhance developer productivity and ensure robust application development. It has styles that are inheritedly fitting for the koi foundation brand.

Getting Started

Installation

To integrate Koi Pool into your project, ensure you have React and TypeScript set up. Then, install the library using either npm or yarn:

npm install koi-pool
# or
yarn add koi-pool

Components

Modals

GenericModalBase

A foundational modal component providing essential functionality.

Props
    handleClose: () => void // Function to close the modal.
    isOpen: boolean // Indicates if the modal is visible.
    children: ReactNode // Content displayed inside the modal.
    modalAttributes?: HTMLAttributes<HTMLDivElement> // Additional HTML attributes for the modal.
Usage
import { GenericModalBase } from 'koi-pool';

<GenericModalBase isOpen={isOpen} handleClose={handleClose}>
  <p>Modal content</p>
</GenericModalBase>

GenericModal

Extends GenericModalBase with a title and action buttons.

Props
    // Inherits GenericModalBaseProps.
    title: ReactNode // Title of the modal, can either be a string which will become a h1, or any other React Node
    actionButtons?: ReactNode[] // Action buttons for the modal.
    actionGroupAttributes?: HTMLAttributes<HTMLDivElement> // Customizes the button groups div attributes
    bodyAttributes?: HTMLAttributes<HTMLDivElement> // Customizes the body wrapping the children's div attributes
    cardAttributes?: HTMLAttributes<HTMLDivElement> // Customizes the card of the modal div attributes
Usage

import { GenericModal, Button } from 'koi-pool';

<GenericModal
  isOpen={isOpen}
  handleClose={handleClose}
  title="Modal Title"
  actionButtons={[
    <Button onClick={actionHandler}>Action</Button>
  ]}>
  <p>Modal content</p>
</GenericModal>

GenericAcceptanceModal

A specialized modal for acceptance actions, extending GenericModal.

Props
    // Includes all GenericModalProps excluding actionButtons prop.
    handleSubmit: () => void // Function for submission action.
Usage

import { GenericAcceptanceModal } from 'koi-pool';

<GenericAcceptanceModal
  isOpen={isOpen}
  handleClose={handleClose}
  handleSubmit={handleSubmit}
  title="Confirm Submission"
>
  <p>Confirm submission?</p>
</GenericAcceptanceModal>

GenericModalWithTabs

A versatile modal component that supports tabbed navigation for organizing content into separate sections.

Props
    // Inherits properties from GenericModalProps except for children and title.
    tabs: GenericModalTabsProps[] // An array of tab objects, each containing title, body, and optional actionButtons.

GenericModalTabsProps

    title: string // the title for the tab, what the user will click on
    body: ReactNode // the content of that tab
    actionButtons?: ReactNode[] // The action buttons at the bottom of the modal, optional
Usage

import { GenericModalWithTabs } from 'koi-pool';

const tabs = [
  {
    title: "Tab 1",
    body: <p>Content for Tab 1</p>,
  },
  {
    title: "Tab 2",
    body: <p>Content for Tab 2</p>,
    actionButtons: [<Button>Button 2</Button>]
  },
];

<GenericModalWithTabs
  isOpen={isOpen}
  handleClose={handleClose}
  tabs={tabs}
/>

This component renders a modal with tabbed navigation at the top. Users can switch between tabs to view different content sections. Each tab can have its own set of action buttons, or none at all.

Buttons

IconButton

A button component for displaying icons.

Props
    // Any default Button html attributes
    className?: string // Custom class name.
    variants?: 'standard' | 'disabled'.
    src: string // Image source URL.
    alt?: string // Image alt text.
    isActive? boolean // Active state indicator.
Usage
import { IconButton } from 'koi-pool';
import icon from './icon-path'
<IconButton src={icon} alt="Icon" />

CloseButton

A button specifically designed for closing or dismissing content.

Props
    // Any default Button html attributes
    className?: string // Custom class name.
Usage

import { CloseButton } from 'koi-pool';

<CloseButton />

Button

A flexible button component supporting various states and variants.

Props
    // Any default Button html attributes
    className?: string // Custom class name.
    variants?: 'cancel' | 'standard' | 'disabled'.
    children: ReactNode // Button content.
    isActive?: boolean // Active state indicator.

#####Usage


import { Button } from 'koi-pool';

<Button variants="cancel">Cancel</Button>