Giter Site home page Giter Site logo

would-code-again / paper-badge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from polymerelements/paper-badge

0.0 1.0 0.0 54 KB

Material Design status descriptors for elements

Home Page: https://elements.polymer-project.org/elements/paper-badge?view=demo:demo/index.html

HTML 100.00%

paper-badge's Introduction

Build status

Demo and API docs

##<paper-badge>

<paper-badge> is a circular text badge that is displayed on the top right corner of an element, representing a status or a notification. It will badge the anchor element specified in the for attribute, or, if that doesn't exist, centered to the parent node containing it.

Badges can also contain an icon by adding the icon attribute and setting it to the id of the desired icon. Please note that you should still set the label attribute in order to keep the element accessible. Also note that you will need to import the iron-iconset that includes the icons you want to use. See iron-icon for more information on how to import and use icon sets.

Example:

<div style="display:inline-block">
  <span>Inbox</span>
  <paper-badge label="3"></paper-badge>
</div>

<div>
  <paper-button id="btn">Status</paper-button>
  <paper-badge icon="favorite" for="btn" label="favorite icon"></paper-badge>
</div>

<div>
  <paper-icon-button id="account-box" icon="account-box" alt="account-box"></paper-icon-button>
  <paper-badge icon="social:mood" for="account-box" label="mood icon"></paper-badge>
</div>

Styling

The following custom properties and mixins are available for styling:

Custom property Description Default
--paper-badge-background The background color of the badge --accent-color
--paper-badge-opacity The opacity of the badge 1.0
--paper-badge-text-color The color of the badge text white
--paper-badge-width The width of the badge circle 20px
--paper-badge-height The height of the badge circle 20px
--paper-badge-margin-left Optional spacing added to the left of the badge. 0px
--paper-badge-margin-bottom Optional spacing added to the bottom of the badge. 0px
--paper-badge Mixin applied to the badge {}

paper-badge's People

Watchers

 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.