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

@polymer/paper-toolbar

v3.0.1

Published

A material design toolbar that is easily customizable

Downloads

10,821

Readme

Published on NPM Build status Published on webcomponents.org

<paper-toolbar>

This element has been deprecated in favor of app-layout.

paper-toolbar is a horizontal bar containing items that can be used for label, navigation, search and actions. The items placed inside the paper-toolbar are projected into a class="horizontal center layout" container inside of paper-toolbar's Shadow DOM. You can use flex attributes to control the items' sizing.

Example:

<paper-toolbar>
  <paper-icon-button slot="top" icon="menu" on-tap="menuAction"></paper-icon-button>
  <div slot="top" class="title">Title</div>
  <paper-icon-button slot="top" icon="more-vert" on-tap="moreAction"></paper-icon-button>
</paper-toolbar>

paper-toolbar has a standard height, but can made be taller by setting tall class on the paper-toolbar. This will make the toolbar 3x the normal height.

<paper-toolbar class="tall">
  <paper-icon-button slot="top" icon="menu"></paper-icon-button>
</paper-toolbar>

Apply medium-tall class to make the toolbar medium tall. This will make the toolbar 2x the normal height.

<paper-toolbar class="medium-tall">
  <paper-icon-button slot="top" icon="menu"></paper-icon-button>
</paper-toolbar>

When tall, items can pin to either the top (default), middle or bottom. Use middle slot for middle content and bottom slot for bottom content.

<paper-toolbar class="tall">
  <paper-icon-button slot="top" icon="menu"></paper-icon-button>
  <div slot="middle" class="title">Middle Title</div>
  <div slot="bottom" class="title">Bottom Title</div>
</paper-toolbar>

For medium-tall toolbar, the middle and bottom contents overlap and are pinned to the bottom. But middleJustify and bottomJustify attributes are still honored separately.

To make an element completely fit at the bottom of the toolbar, use fit along with bottom.

<paper-toolbar class="tall">
  <div id="progressBar" slot="bottom" class="fit"></div>
</paper-toolbar>

When inside a paper-header-panel element with mode="waterfall-tall", the class .animate is toggled to animate the height change in the toolbar.

Styling

The following custom properties and mixins are available for styling:

Custom property | Description | Default ----------------|-------------|---------- --paper-toolbar-title | Mixin applied to the title of the toolbar | {} --paper-toolbar-background | Toolbar background color | --primary-color --paper-toolbar-color | Toolbar foreground color | --dark-theme-text-color --paper-toolbar-height | Custom height for toolbar | 64px --paper-toolbar-sm-height | Custom height for small screen toolbar | 56px --paper-toolbar | Mixin applied to the toolbar | {} --paper-toolbar-content | Mixin applied to the content section of the toolbar | {} --paper-toolbar-medium | Mixin applied to medium height toolbar | {} --paper-toolbar-tall | Mixin applied to tall height toolbar | {} --paper-toolbar-transition | Transition applied to the .animate class | height 0.18s ease-in

Accessibility

<paper-toolbar> has role="toolbar" by default. Any elements with the class title will be used as the label of the toolbar via aria-labelledby.

See: Documentation, Demo.

Usage

Installation

npm install --save @polymer/paper-toolbar

In an html file

<html>
  <head>
    <script type="module">
      import '@polymer/paper-toolbar/paper-toolbar.js';
    </script>
  </head>
  <body>
    <paper-toolbar>
      <div slot="top" class="title">Title</div>
    </paper-toolbar>
  </body>
</html>

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/paper-toolbar/paper-toolbar.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
      <paper-toolbar>
        <div slot="top" class="title">Title</div>
      </paper-toolbar>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Contributing

If you want to send a PR to this element, here are the instructions for running the tests and demo locally:

Installation

git clone https://github.com/PolymerElements/paper-toolbar
cd paper-toolbar
npm install
npm install -g polymer-cli

Running the demo locally

polymer serve --npm
open http://127.0.0.1:<port>/demo/

Running the tests

polymer test --npm