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

umbr-resizer-two

v1.0.16

Published

A simple, dependency-free vanilla JS class for resizable split views.

Readme

umbr-resizer-two

A lightweight, zero-dependency TypeScript library that automatically manages a resizable handle between two children in a container. It uses a MutationObserver to stay active even if panels are dynamically added or removed.

Installation

npm install umbr-resizer-two

Features

  • Dynamic Detection: Automatically injects a resizer handle when exactly two children are present.
  • Flex-Based: Uses CSS flexbox for smooth, responsive layouts.
  • Directional Support: Supports both horizontal (columns) and vertical (rows) resizing.
  • State Persistence: Easily save and restore panel sizes using callbacks.
  • Highly Customizable: Pass custom CSS properties directly to the resizer handle.

Quick Start

HTML Structure

You only need a container with two child elements.

<div id="container">
  <div class="panel">Panel 1</div>
  <div class="panel">Panel 2</div>
</div>

Initialization

import { ResizerTwo } from 'umbr-resizer-two';

const container = document.getElementById("container");

const resizer = new ResizerTwo({
  container: container,
  direction: "horizontal", // or "vertical"
  minFlex: { firstChild: 0.1, secondChild: 0.1 },
  handleStyles: {
    width: "5px",
    backgroundColor: "#555",
    cursor: "col-resize",
  },
  initalFlex: { firstChild: 1, secondChild: 1 }, 
});

// Save the state when the user finishes resizing
resizer.on(() => {
  const currentValues = resizer.getFlexValues();
  localStorage.setItem('my_layout', JSON.stringify(currentValues));
});

Options API

| Property | Type | Description | | --- | --- | --- | | container | HTMLDivElement | The parent element containing the two panels. | | direction | "horizontal" | "vertical" | The flow of the children. | | minFlex | ResizerTwoChildrenFlex | The minimum flex value allowed for each child. | | initalFlex | ResizerTwoChildrenFlex | (Optional) The starting flex values for the panels. | | handleStyles | Record<string, string> | CSS key-value pairs to style the resizer handle. |


Methods

  • on(callback: () => void): Adds a listener that fires whenever the panels are resized.
  • getFlexValues(): Returns the current flex values for both children.
  • remove(callback: () => void): Removes a specific listener.
  • dispose(): Cleans up the mutation observer, event listeners, and removes the handle from the DOM.