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

@papit/splitter

v0.0.4

Published

A simple splitter following the window splitter pattern, can be used for both horzontal and vertical modes.

Downloads

370

Readme

@papit/splitter

A resizable split-pane component implemented as a Web Component. Use a splitter when you want to let users control the relative size of two panels by dragging a separator or using the keyboard.

The component follows the WAI-ARIA Window Splitter Pattern, supports keyboard interaction, and works in both vertical (side by side) and horizontal (stacked) orientations.

See the pattern: https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/

Logo


Type Tests NPM version


Installation

npm install @papit/splitter

Usage

Import

import "@papit/splitter";

Basic example

<pap-splitter label="Sidebar" style="height: 400px;">
  <nav slot="primary">Sidebar</nav>
  <main slot="secondary">Content</main>
</pap-splitter>

Horizontal split

<pap-splitter split="horizontal" label="Editor" style="height: 600px;">
  <div slot="primary">Editor</div>
  <div slot="secondary">Terminal</div>
</pap-splitter>

With custom bounds

<pap-splitter label="Sidebar" min="20" max="80" style="height: 400px;">
  <nav slot="primary">Sidebar</nav>
  <main slot="secondary">Content</main>
</pap-splitter>

Slots

| Slot | Description | | ----------- | --------------------------------------------------------------- | | primary | The primary pane. Its size is controlled by the splitter value. | | secondary | The secondary pane. Takes up all remaining space. |


Attributes / Properties

| Attribute | Property | Type | Default | Description | | ----------- | ---------- | ---------------------------- | ------------ | ------------------------------------------------ | | split | split | "vertical" \| "horizontal" | "vertical" | Orientation of the splitter | | label | label | string | "" | Accessible label for the separator handle | | min | min | number | 0 | Minimum size of the primary pane as a percentage | | max | max | number | 100 | Maximum size of the primary pane as a percentage | | step | step | number | 5 | Keyboard step size in percent | | data-drag | dragging | boolean | false | Reflects whether the separator is being dragged |


Keyboard Interaction

The separator handle is the focusable widget. All keyboard interaction happens when it has focus.

| Key | Behavior | | ------------ | ------------------------------------------------------------- | | ArrowLeft | Decrease primary pane size by one step (vertical mode) | | ArrowRight | Increase primary pane size by one step (vertical mode) | | ArrowUp | Decrease primary pane size by one step (horizontal mode) | | ArrowDown | Increase primary pane size by one step (horizontal mode) | | Home | Set primary pane to its minimum size | | End | Set primary pane to its maximum size | | Enter | Collapse the primary pane, or restore it to the previous size | | Escape | Cancel a drag and restore the previous size |


Accessibility

This component implements the ARIA Window Splitter Pattern using role="separator" on the drag handle. It automatically manages:

  • role="separator"
  • aria-orientation
  • aria-valuemin, aria-valuemax, aria-valuenow
  • aria-controls pointing to the primary pane
  • Full keyboard interaction

References:


Styling

The component exposes a --value custom property that reflects the current primary pane size as a percentage. You can use CSS ::part() to style the internal regions.

pap-splitter::part(separator) {
  background: #ccc;
  width: 4px;
}

pap-splitter::part(thumb) {
  background: #888;
  border-radius: 2px;
}

pap-splitter[data-drag]::part(separator) {
  background: #0070f3;
}

Available parts:

| Part | Description | | ----------- | ------------------------------------ | | primary | The primary pane wrapper | | secondary | The secondary pane wrapper | | separator | The draggable divider element | | thumb | The visual handle inside the divider |


Contributing

Contributions are welcome.

Please ensure:

  • tests pass
  • linting passes
  • behavior follows the ARIA Window Splitter pattern

Submit pull requests through the GitHub repository.


License

Licensed under the @Papit License 1.0 Copyright (c) 2024 Henry Pap (@onkelhoy)

Key points

  • ✅ Free to use in commercial projects
  • ✅ Free to modify and distribute
  • ✅ Attribution required
  • ❌ Cannot resell the component itself as a standalone product

See the LICENSE file for full details.


Related Components


Support

For issues, questions, or contributions, please visit the GitHub repository.