All Projects → DimitryDushkin → sliding-pane

DimitryDushkin / sliding-pane

Licence: MIT License
Pane that slides out of the window side

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
CSS
56736 projects

Projects that are alternatives of or similar to sliding-pane

Bonsai
🌲 Bonsai makes your view controller custom size.
Stars: ✭ 63 (-47.5%)
Mutual labels:  popup
Menu
The most customizable menu for macOS apps.
Stars: ✭ 84 (-30%)
Mutual labels:  popup
vue-resize-split-pane
Splittable and resizable panes for Vue.js
Stars: ✭ 54 (-55%)
Mutual labels:  pane
ng2-dialog-window
Modal/dialog windows and popups module for Angular applications.
Stars: ✭ 17 (-85.83%)
Mutual labels:  popup
CountdownView
Simple countdown view with custom animations
Stars: ✭ 70 (-41.67%)
Mutual labels:  popup
neodigm55
An eclectic low-code vanilla JavaScript UX micro-library for those that defiantly think for themselves.
Stars: ✭ 14 (-88.33%)
Mutual labels:  popup
MaterialDesign-Toast
Custom android Toast with Material Design
Stars: ✭ 70 (-41.67%)
Mutual labels:  popup
RDPopup
A simple way to add custom Popup. Design on Nib and use as you want. Written in Objective-C.
Stars: ✭ 19 (-84.17%)
Mutual labels:  popup
customer-ajax-login
Free magento 2 extension for Popup and AJAX based Login and Sign Up | Manish Joy
Stars: ✭ 14 (-88.33%)
Mutual labels:  popup
react-apple-signin-auth
 Apple signin for React using the official Apple JS SDK
Stars: ✭ 58 (-51.67%)
Mutual labels:  popup
mac-ibm-notifications
macOS agent used to display custom notifications and alerts to the end user.
Stars: ✭ 206 (+71.67%)
Mutual labels:  popup
react-native-popup
React Native Animated Popup Modal
Stars: ✭ 19 (-84.17%)
Mutual labels:  popup
XPopupExt
XPopup扩展功能库,基于XPopup强大的弹窗能力和PickerView的选择器逻辑,封装了时间选择器弹窗、城市选择器弹窗和条件选择器。
Stars: ✭ 248 (+106.67%)
Mutual labels:  popup
ArminC-uBlock-Settings
⚙️ ArminC's settings for uBlock₀ - remove most of the ads, pop-ups and trackers.
Stars: ✭ 24 (-80%)
Mutual labels:  popup
WeiboPopupMenu
模仿新浪微博菜单弹出界面(已停止维护)
Stars: ✭ 75 (-37.5%)
Mutual labels:  popup
corner-popup
jQuery pop-up script displaying various types of content in corner of browser
Stars: ✭ 23 (-80.83%)
Mutual labels:  popup
vim-hitspop
💬 Popup the number of search results
Stars: ✭ 38 (-68.33%)
Mutual labels:  popup
SPStorkController
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,515 (+1995.83%)
Mutual labels:  popup
Popup-my-Bookmarks
A browser extension that providing a more efficient way to view and manage your bookmarks menu
Stars: ✭ 88 (-26.67%)
Mutual labels:  popup
plain-modal
The simple library for customizable modal window.
Stars: ✭ 21 (-82.5%)
Mutual labels:  popup

React Sliding Pane

Pane that slides out of the window side. Like panes from Google Tag Manager.

Features:

  • Animated open-close
  • Smooth animation based on CSS translate
  • Outside click or left top arrow click to close
  • Efficient: pane content is not rendered when pane is closed
  • Based on react-modal
  • Close on escape support
  • Typescript support
  • Runtime props validation in dev via "prop-types"
  • React Strict mode covered
  • Small — 8 Kb gzip (react-sliding-pane + react-modal as dependency)

See changelog.

npm version downloads per week bundle size

Thanks BrowserStack for support!

Table of contents

Example

Try example

When to use (UX)

I've found sliding pane very helpful in situations when normal modal window (or just popup) is not enough: long list with pagination, multi-step form or nested popups.

How to use

Install module and peer dependencies:

npm i --save react react-dom react-sliding-pane

import React, { Component, useState } from "react";
import { render } from "react-dom";
import SlidingPane from "react-sliding-pane";
import "react-sliding-pane/dist/react-sliding-pane.css";

const App = () => {
  const [state, setState] = useState({
    isPaneOpen: false,
    isPaneOpenLeft: false,
  });

  return (
    <div>
      <button onClick={() => setState({ isPaneOpen: true })}>
        Click me to open right pane!
      </button>
      <div style={{ marginTop: "32px" }}>
        <button onClick={() => setState({ isPaneOpenLeft: true })}>
          Click me to open left pane with 20% width!
        </button>
      </div>
      <SlidingPane
        className="some-custom-class"
        overlayClassName="some-custom-overlay-class"
        isOpen={state.isPaneOpen}
        title="Hey, it is optional pane title.  I can be React component too."
        subtitle="Optional subtitle."
        onRequestClose={() => {
          // triggered on "<" on left top click or on outside click
          setState({ isPaneOpen: false });
        }}
      >
        <div>And I am pane content. BTW, what rocks?</div>
        <br />
        <img src="img.png" />
      </SlidingPane>
      <SlidingPane
        closeIcon={<div>Some div containing custom close icon.</div>}
        isOpen={state.isPaneOpenLeft}
        title="Hey, it is optional pane title.  I can be React component too."
        from="left"
        width="200px"
        onRequestClose={() => setState({ isPaneOpenLeft: false })}
      >
        <div>And I am pane content on left.</div>
      </SlidingPane>
    </div>
  );
};

render(<App />, document.getElementById("app"));

Properties

Prop Required Default Description
isOpen Is pane open
title Title in header
subtitle Subtitle in header
from "right" Direction from pane will appear
children Content of pane
className CSS class name. See react-modal
overlayClassName CSS class name of overlay. See react-modal
width CSS string for width pane.
closeIcon Custom close icon
shouldCloseOnEsc Enable pane close on ESC
hideHeader Hide pane header
onRequestClose Called on close icon press
onAfterOpen Called after open

How to develop

npm run docs
open docs/example.html
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].