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

floating-window-ui

v1.3.6

Published

TypeScript component for floating resizable windows in React. <br /> <br /> ![Screenshot 1](https://raw.githubusercontent.com/HARDY8118/floating-window-ui/1e66cadcf1f5488ee66af5e9f2562a9416ad388e/screenshots/screenshot1.png "Screenshot 1")

Downloads

459

Readme

Floating Window

TypeScript component for floating resizable windows in React. Screenshot 1


Installing

npm install floating-window-ui

OR

yarn add floating-window-ui

Usage

import React from "react";
import Window from "floating-window-ui";

const App = () => {
  return (
    <Window
      id="react-window"
      height={800}
      width={400}
      resizable={true}
      titleBar={{
        icon: "⚛",
        title: "React App Window",
        buttons: { minimize: true, maximize: true },
      }}
    >
      <div>...</div>
    </Window>
  );
};

export default App;

Window component

A floating window which can be dragged, minimized, maximized and moved across.

Props

| NAME | TYPE | DEFAULT | REQUIRED | DESCRIPTION | |------|------|---------|----------|-------------| |id|string| |✓|HTML id attribute| |height|number||✓|Height of window including Title Bar| |width|number||✓|Width of window including| |top|number|0|✗|Top position of window with repect to parent element in px| |left|number|0|✗|Left position of window with repect to parent element in px| |resizable|boolean|false|✗|Make window resizable of not| |titleBar|object| |✗|Refer Title Bar props| |style|object|{}|&cross|CSS styles applied to content window|

Title Bar properties

Title bar is a prop passed as an object to the Window Component for configuring title bar.

| NAME | TYPE | DEFAULT | REQUIRED | DESCRIPTION | |------|------|---------|----------|-------------| |icon|string|HTMLImageElement|" "|✗|Icon to be displayed on top left of window| |title|string|"Untitled window"|✗|Window title displayed on center of title bar| |buttons|object| |✗|Refer Title Bar Button props

Title Bar Buttons properties

Buttons properies set whether to display certian buttons or not. If any property for titleBar is set in the window component, value for all buttons defaults to false.

| NAME | TYPE | DEFAULT | REQUIRED | DESCRIPTION | |------|------|---------|----------|-------------| |minimize|boolean|true|✗|Displaying minimize button| |maximize|boolean|true|✗|Displaying maximize button| |close|()=>void|()=>{}|✗|Display close button. (Call provided function)|


Contributing

For contributing open a Pull Request with any changes/suggestions. Any kind of contribution will be much appreciated.

Known Issues

Due to a bug in Firefox, the window does not moves with the mouse while dragging but will move to final position on dropping.

Refer Set screen coordinates during HTML5 drag event

Also see Dragging window on Firefox