Git Product home page Git Product logo

paper-toolbar's Introduction

Build status

Demo and API docs

##<paper-toolbar>

Material design: Toolbars

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 icon="menu" on-tap="menuAction"></paper-icon-button>
  <div class="title">Title</div>
  <paper-icon-button 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 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 icon="menu"></paper-icon-button>
</paper-toolbar>

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

<paper-toolbar class="tall">
  <paper-icon-button icon="menu"></paper-icon-button>
  <div class="middle title">Middle Title</div>
  <div class="bottom 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" class="bottom fit"></div>
</paper-toolbar>

When inside a paper-header-panel element, 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.

paper-toolbar's People

Contributors

frankiefu avatar blasten avatar tedium-bot avatar notwaldorf avatar bicknellr avatar dfreedm avatar cdata avatar ebidel avatar rictic avatar ssorallen avatar abdonrd avatar samccone avatar robdodson avatar addyosmani avatar albeec13 avatar tyriar avatar istvank avatar robliao avatar tjsavage avatar willchan avatar gmascia avatar idleherb avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.