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

@agentlab/react-collapse-pane

v2.0.3

Published

The splittable, draggable and collapsible react layout library.

Downloads

37

Readme

react-collapse-pane

This is intended to be the simple, reliable, configurable, and elegant solution to having splittable, draggable and collapsible panes in your React application.

[click for storybook demo]

[click for documentation site]

Getting Started :rocket:

Install react-collapse-pane:

npm i react-collapse-pane

# or for yarn

yarn add react-collapse-pane

Once installed you can import the SplitPane component in your code.

import { SplitPane } from "react-collapse-pane";

If you're using Typescript the SplitPaneProps, as well as a few other helper types type is also available.

import { SplitPane, SplitPaneProps, ResizerOptions, CollapseOptions, SplitPaneHooks } from "react-collapse-pane";

Quick Start Usage :fire:

The only component you must interact with is SplitPane. This serves as a wrapper for all of the children you wish to lay out.

All you're required to give is a split prop which can be either "horizontal" or "vertical". This identifies what the orientation of the split panel will be.

<SplitPane split="vertical" collapse={true}>
  <div>This is the first div</div>
  <div>This is the second div</div>
  <div>This is the third div</div>
  This is the fourth but not a div!
</SplitPane>

What you just did is make a split collapsible panel layout!

Congrats! That was easy! :grin:

This basically splits the children vertically (i.e. full-height split). The children can be any valid React child. If a child is null it will be excluded from being split or displayed.

By default there is a 1px divider with a grabbable surface of 1rem width or height (depending on the split). If you hover over the divider a button will appear that you can use to collapse the panel.

There is no limit to the number of elements you have as children. The SplitPane will split them all accordingly.

But what about styling the resizer, the buttons, controlling the animations, or RTL support? :sob:

This library supports all of these things and more!

For more details check out the documentation

Documentation

Documentation can be found at https://collapse-pane.zurg.dev

If you notice an issue then please make an issue or a PR! All docs are generated from the docs folder in the master branch.

Contributing and PRs :sparkling_heart:

If you would like to contribute please check out the contributor guide

All contributions are welcome! All issues and feature requests are welcome!

Credit and Attribution :pray:

This project did not start off from scratch. The foundation of the project was the excellently written react-multi-split-pane library which is itself a typescript rewrite of the react-split-pane library.

Much gratitude to their authors, @NeoRaider and @tomkp

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!