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

@polymer/paper-badge

Package Overview
Dependencies
Maintainers
7
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymer/paper-badge

Material design status message for elements

  • 3.0.0-pre.21
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.3K
decreased by-22.65%
Maintainers
7
Weekly downloads
 
Created
Source

Build status

Demo and API docs

Changes in 2.0

  • Target updates target in an animation frame rather than 1 ms.

<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 propertyDescriptionDefault
--paper-badge-backgroundThe background color of the badge--accent-color
--paper-badge-opacityThe opacity of the badge1.0
--paper-badge-text-colorThe color of the badge textwhite
--paper-badge-widthThe width of the badge circle20px
--paper-badge-heightThe height of the badge circle20px
--paper-badge-margin-leftOptional spacing added to the left of the badge.0px
--paper-badge-margin-bottomOptional spacing added to the bottom of the badge.0px
--paper-badgeMixin applied to the badge{}

Keywords

FAQs

Package last updated on 23 Jun 2018

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