New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bgoodman/slide-drawer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bgoodman/slide-drawer

Custom element containing a hidden sidebar wich reveals itself by sliding in from off the page.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

slide-drawer

Installation

npm install @bgoodman/slide-drawer

yarn add @bgoodman/slide-drawer

Usage

<!DOCTYPE html>
<html>
<head>
    <title>slide-drawer</title>
    <script type="module" src="./dist/index.js"></script>
    <style>
        html {
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>

<body>
    <slide-drawer>
        <div>Item 1</div>
        <div>Item 2</div>
        <div>Item 3</div>
    </slide-drawer>


    <button id="open-drawer">Toggle Drawer</button>

    <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>

    <img src="http://lorempixel.com/400/200/"/>
</body>

<script>
    document.querySelector("#open-drawer").addEventListener("click", () => {
        document.querySelector("slide-drawer").toggle()
    })
</script>


</html>

Attributes

open

Defines if the drawer is visible. Takes values "true" or "false" (default).

position

Defines which side of the page the drawer slides in from.

Takes values "right" (default), "left", "bottom" and "top".


Methods

toggle(): void

Opens(Closes) the drawer if it is currently closed(open).


Events

"slide-drawer-open"

Emitted when the drawer's open attribute is set to "true".

"slide-drawer-close"

Emitted when the drawer's open attribute is set to "false".

Keywords

FAQs

Package last updated on 20 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc