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

ember-cli-mdc-drawer

v3.0.17

Published

ember-cli addon for @material/drawer.

Downloads

314

Readme

ember-cli-mdc-drawer

ember-cli addon for @material/drawer.

Installation

ember install ember-cli-mdc-drawer

Components and Mixins

Top-Level Components

Other Topics

MdcDrawer

Description

Add a side drawer component to the page.

Usage

<MdcDrawer @style={{["dismissible"|"modal"]}} @open={{this.open}}>
  {{!-- drawer content --}}
</MdcDrawer>

Attributes

  • @style - The type of drawer. The drawer is permanent is no style provided.
  • open - Open/closes the drawer.

Adding content to the drawer

The content of a drawer goes inside a <MdcDrawerContent> block. For menu items, we use <MdcList> and <MdcListGroupSubheader> components.

<MdcDrawer @open={{this.open}}>
  {{!-- ... --}}
  
  <MdcDrawerContent>
    <MdcList>
      <MdcListItemLinkTo @route="index"><MdcListItemGraphicIcon @icon="inbox" />Inbox</MdcListItemLinkTo>
      <MdcListItemLinkTo @route="star"><MdcListItemGraphicIcon @icon="star" />Starred</MdcListItemLinkTo>
      <MdcListItemLinkTo @route="sent"><MdcListItemGraphicIcon @icon="send" />Sent Mail</MdcListItemLinkTo>
      <MdcListItemLinkTo @route="drafts"><MdcListItemGraphicIcon @icon="drafts" />Drafts</MdcListItemLinkTo>

      <MdcListDivider />

      <MdcListGroupSubheader>Folders</MdcListGroupSubheader>
      <MdcListItemLinkTo @route="all"><MdcListItemGraphicIcon @icon="email" />All Mail</MdcListItemLinkTo>
      <MdcListItemLinkTo @route="trash"><MdcListItemGraphicIcon @icon="delete" />Trash</MdcListItemLinkTo>
      <MdcListItemLinkTo @route="spam"><MdcListItemGraphicIcon @icon="report" />Spam</MdcListItemLinkTo>    </MdcList>
  </MdcDrawerContent>
</MdcDrawer>

Opening/closing the drawer

The @open attribute on the <MdcDrawer> is used to open and close the drawer for both persistent and modal styles. When @open is true, then the drawer will open. When @open is false the drawer will close.

If the drawer has @style="modal", then drawer automatically closes after clicking an item in the drawer.

Adding a header to the drawer

The header in the drawer is the top portion of the drawer where you display application specific information, such as how is currently logged into the application. You can add a header to the drawer by adding the {{mdc-drawer-header}} block component.

<MdcDrawer @open={{this.open}}>
  <MdcDrawerHeader>
    <MdcDrawerTitle>Mail</MdcDrawerTitle>
    <MdcDrawerSubtitle>[email protected]</MdcDrawerSubtitle>
  </MdcDrawerHeader>
  
  {{!-- drawer content --}}

</MdcDrawer>

Persistent vs. Modal

A persistent drawer remains open until the user explicitly closes the drawer. A modal drawer appears on demand (like a modal dialog), and disappears after clicking item in the drawer. If @style="modal", then the <MdcDrawer> component will automatically add a <MdcDrawerScrim> component as the next sibling of the <MdcDrawer> component. Likewise, if you switch from a modal drawer to a dismissible drawer, the <MdcDrawer> component will automatically remove the <MdcDrawerScrim> element from the page.

App Content

When working with the drawer component, the page content must placed inside a <MdcDrawerAppContent> component. This ensures the drawer and page function correctly, especially when changing between styles.

<MdcDrawer @style={{this.style}}>
  {{!-- drawer content --}}
</MdcDrawer>

<MdcDrawerAppContent>
  {{!-- app content --}}

</MdcDrawerAppContent>