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

@fullkekw/popup

v2.0.9

Published

React Popup component written on Typescript. Compatible with NextJS & Vite!

Readme

cover

Headless popup component for React, with built-in typescript types!

🎉 Installation

$ npm install @fullkekw/popup
$ pnpm install @fullkekw/popup
$ yarn add @fullkekw/popup

Usage

import { FC } from 'react';
import { PopupLayer, PopupWindow, PopupButton} from '@fullkekw/popup'
import '@fullkekw/popup/css'; // Basic styles

const Page: FC = (props) => {
  const popupId1 = 'popupId1'
  const popupId2 = 'popupId2'

  return <body>
    <PopupLayer>
      <PopupWindow id={popupId1}>
        Popup Content 1

        <PopupButton popupId={popupId1}>
          Close popup 1
        </PopupButton>

        <PopupButton popupId={popupId2}>
          Open popup 2
        </PopupButton>
      </PopupWindow>

    {/* Nested window always will be on top of the stacking context */}
      <div>
        <PopupWindow id={popupId2}>
          Popup Content 2

          <PopupButton popupId={popupId2}>
            Close popup 2
          </PopupButton>
        </PopupWindow>
      </div>
    </PopupLayer>
  </div>
}

export default Page;

✨ Features

  • Popup can be closed by press escape or by click on layer
  • Synthetic state handling (useState can be passed into the component)
  • Headless component with only basic styling
  • Built-in animations
  • Prevent user from state change (only synthetic)
  • Implement WAI-ARIA Dialog Pattern
  • Popups can be nested
  • Will always be on top of the stacking context
  • Hightly customizable (you can even turn off scroll hide!)
  • Does not break elements with sticky position on oveflow hide
  • Render window content on demand
  • onOpen & noExit hooks

👀 Examples

Synthetic state handle. Will be opened by default

import { FC, useState } from 'react';
import { PopupLayer, PopupWindow, PopupButton} from '@fullkekw/popup'
import '@fullkekw/popup/css';

const Page: FC = (props) => {
  const popupId1 = 'popupId1'

  const [state, setState] = useState(true)

  return <body>
    <PopupLayer>
      <PopupWindow id={popupId1} isOpen={state} setIsOpen={setState}>
        Popup Content

        <PopupButton popupId={popupId1}>
          Close popup
        </PopupButton>
      </PopupWindow>
    </PopupLayer>
  </body>
}

export default Page;

Disable exit on layer & escape, popup content will be rendered on demand

import { FC } from 'react';
import { PopupLayer, PopupWindow, PopupButton} from '@fullkekw/popup'
import '@fullkekw/popup/css';

const Page: FC = (props) => {
  const popupId1 = 'popupId1'

  return <body>
    <PopupLayer>
      <PopupWindow id={popupId1} settings={{exitOnLayer: false, exitOnDocument: false}} renderOnDemand>
        Popup Content

        <PopupButton popupId={popupId1}>
          Close popup
        </PopupButton>
      </PopupWindow>
    </PopupLayer>
  </body>
}

export default Page;

⚙️ API

export type PopupWindowAnimationType = 'fade' | 'scale' | null

export interface PopupSettings {
  /** Prevent state change due to user interactions (only synthetic) */
  preventStateChange?: boolean

  /** 
   * Close popup on Escape
   * 
   * @default true
   */
  exitOnEscape?: boolean

  /** 
   * Close popup on document click
   * 
   * @default true
   */
  exitOnDocument?: boolean

  /** 
   * Disable document scroll when popup open
   * 
   * @default true
   */
  disableScroll?: boolean
}



export interface PopupLayerProps {
  children: ReactNode | ReactNode[]

  className?: string
  settings?: PopupSettings
}



export interface PopupWindowProps extends React.DetailsHTMLAttributes<HTMLDivElement> {
  id: string

  children?: ReactNode | ReactNode[]
  layerClassName?: string
  settings?: PopupSettings

  /** Passed useState value */
  isOpen?: boolean

  /** Passed useState setter */
  setIsOpen?(isOpen: boolean): void

  /** 
   * Popup animation
   * 
   * @default "scale"
   */
  animation?: PopupWindowAnimationType
}



export interface PopupButtonProps extends React.DetailsHTMLAttributes<HTMLElement> {
  popupId: string

  children?: ReactNode | ReactNode[]

  onClick?(e: React.MouseEvent): void
  disabled?: boolean

  /** 
   * Tag name
   * 
   * @default "button"
   */
  as?: 'button' | 'div'
}

☁️ Migration Guides

©️ License

Licensed under MIT