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

react-window-system

v0.0.2-alpha.0

Published

A window system for React

Readme

🪟 React Window System

License: MIT PRs Welcome Created by GunseiKPaseri npm version

React Window System is a reproduction of the Window system using React. It provides a Window system.

  • maximize
  • minimize
  • close
  • taskbar
  • Snap (like windows)

How to use

Demo: CodeSandBox

npm install react-window-system

See Example.tsx

const windows = [
  {
    id: `${Math.random()}`,
    defaultWindowPos: {
      x: 300 * Math.random(),
      y: 250 * Math.random(),
      height: 200,
      width: 200,
    },
    header: <strong>Title</strong>,
    body: <>Example</>,
  }
]
const WindowSystem = () => {
  <WindowSystem
    windows={windows}
    style={{
      width: 500,
      height: 500,
    }}
  />
}

Documentation

WindowSystem

The <WindowSystem> component will render the window system environment. Please use the element's styles to specify the width and height.

The windows to be displayed can be specified using the windows property. Please manage it externally using useState or similar state management techniques.

windows (required)

| Property | Type | Description | | --- | --- | --- | | id | string | The unique identifier of the window. | | defaultWindowPos | { x: number, y: number, height: number, width: number } | The initial position and size of the window. | | header | ReactNode | The title of the window. | | body | ReactNode | The content of the window. |

Window

In the components specified for the header and body, you can use the useWindow hook to retrieve window information.

By using the useWindow hook, you can access window-related information such as window state, position, and size within the specified components. This allows you to dynamically update and interact with the windows in the WindowSystem component.

  const properties = useWindow()

| Property | Type | Description | | --- | --- | --- | | windowAreaNode | React.RefObject<HTMLDivElement> | The reference to the window area. (Moveable area from <WindowSystem> excluding the taskbar) | | windowProviderNode | React.RefObject<HTMLDivElement> | The reference to the <WindowSystem> | | layerQueue | string[] | List of window IDs sorted in stacked order. | | wsId | string | The ID of the <WindowSystem>. | | closed | boolean | Whether the window is closed. | | id | string | The unique identifier of the window. | | defaultWindowPos | { x: number, y: number, height: number, width: number } | The initial position and size of the window. | | header | ReactNode | The title of the window. | | body | ReactNode | The content of the window. | | maximized | boolean | Whether the window is maximized. | | minimized | boolean | Whether the window is minimized. | | windowPos | { x: number, y: number, height: number, width: number } | The position and size of the window. | | layerIndex | number | The index of the window in the layerQueue. | | isActive | boolean | Whether the window is active. | | bigWindowSuggest | {bigWindow: string} | Show size when maximized at Snap. (for developper) | | activeWindow | string | The ID of the active window. | | closeWindow | () => void | A function to close the window. | | maximizeWindow | () => void | A function to maximize the window. | | minimizeWindow | () => void | A function to minimize the window. | | resizeWindow | (ref: {x: number, y: number, height: number, width: number}, maximize?: string) => void | A function to resize the window. | | hideWindow | () => void | A function to hide the window. |

Customization

You can define custum Window & TaskBar. See DefaultWindow.tsx, DefaultTaskBar.tsx.

import { Window } from "../window/Window";
import type { WindowUIProps } from "../windowSystem/type";

export const CustomWindow = (props: WindowUIProps) => {
  const { window, ...WindowAttr } = props;
  return (
    <Window
      {...WindowAttr}
      window={window}
      style={{
        position: "absolute",
        zIndex: window.layerIndex,
        border: "1px solid #000",
        borderRadius: "4px",
      }}
    >
      <Window.TitleBar
        style={{
          backgroundColor: window.isActive ? "#99f" : "#ccf",
        }}
      >
        <Window.TitleBar.Title
          style={{
            paddingLeft: 4,
          }}
        >
          {window.header}
        </Window.TitleBar.Title>
        <Window.TitleBar.MinimizeButton>_</Window.TitleBar.MinimizeButton>
        <Window.TitleBar.MaximizeButton>
          {window.maximize === "full" ? "❒" : "□"}
        </Window.TitleBar.MaximizeButton>
        <Window.TitleBar.CloseButton>×</Window.TitleBar.CloseButton>
      </Window.TitleBar>
      <Window.Body
        style={{
          backgroundColor: "#fff",
        }}
      >
        {window.body}
      </Window.Body>
    </Window>
  );
};

const CustomWindowSystem = () => {
  return (
    <WindowSystem
      windows={windows}
      style={{
        width: 500,
        height: 500,
      }}
      Window={CustomWindow}
    />
  );
};

Development

To participate in the development, please make sure to install bun as your development environment.

Install

bun install

Run develop server

bun run dev

Check pre-commit

Before committing, please execute the following:

bun run pre-commit