Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dile/dile-app-drawer

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dile/dile-app-drawer

Webcomponent to create a animated menu similar to the material design navigation drawer component

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

@dile/dile-app-drawer

Web component to create a simple animated menu, useful as app global menu, with a look & feel similar to the material design navigation drawer component.

Installation

npm i @dile/dile-app-drawer

Usage

Import the component.

import '@dile/dile-app-drawer/dile-app-drawer.js';

Use the component.

<dile-app-drawer>
  <p><a href="#">Link 1</a></p>
  <p><a href="#">Another link</a></p>
  <p><a href="#">More information</a></p>
  <p><a href="#">Contact us</a></p>
</dile-app-drawer>

Properties

This componen has two properties:

  • opened: Set the state of the component between opened and closed. Boolean property.
  • direction: Defines de animation and direction to open the menú. String property one of "top" or "left". Default is "top".

Methods

The component also provides a set of useful methods to controls the component state programmatically.

  • open(): Opens the menu.
  • close(): Closes the menu.
  • toggle(): Changes the state, from open to close or close to open.

Events

  • dile-app-drawer-closed: Dispatched when the interface closes by any reason.
  • dile-app-drawer-click-outside: This custom event is dispatched when the drawer panel is closed because a user click outside the menu layer.

CSS customization

There are some CSS custom properties to customize the style and the animation.

Custom propertyDescriptionDefault
--dile-app-drawer-content-heightHeight of the menuauto (or 100vh on "letf" direction)
--dile-app-drawer-content-widthWidth of the menu100vw (or auto on "left" direction)
--dile-app-drawer-background-colorBackground color menu layer#ddd
--dile-app-drawer-z-indexz-index menu layer10001
--dile-app-drawer-closed-topDrawer content top position in closed state-100vh (or 0 on "left" direction)
--dile-app-drawer-closed-leftDrawer content left position in closed state0 (or -100vw on "left" direction)
--dile-app-drawer-box-shadowMenu shadow0 1px 8px #000 (or 1px 0 8px #000 on "left" direction)
--dile-app-drawer-modal-background-colorMenu modal layer background colorrgba(20, 20, 20, 0.7)
--dile-app-drawer-modal-z-indexMenu modal layer z-index10000

Keywords

FAQs

Package last updated on 25 Aug 2020

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