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

@anypoint-web-components/anypoint-chip

v0.2.1

Published

A compact material design element that represent and input, attribute, or action. Also styled for Anypoint platform.

Downloads

43

Readme

Published on NPM

Build Status

Published on webcomponents.org

anypoint-chip

A compact material design element that represent and input, attribute, or action.

Example

<style>
.avatar {
  background-color: red;
  color: #fff !important;
  width: 24px;
  height: 24px;
}
</style>
<h2>Basics</h2>
<section>
  <anypoint-chip>Simple chip</anypoint-chip>

  <anypoint-chip>
    <span class="avatar" slot="icon">C</span>
    <span>Chip with icon</span>
  </anypoint-chip>

  <anypoint-chip removable>
    <span class="avatar" slot="icon">R</span>
    Chip that can be removed
  </anypoint-chip>

  <anypoint-chip removable disabled>
    <span class="avatar" slot="icon">D</span>
    Disabled chip
  </anypoint-chip>
</section>

<h2>Input chips</h2>
<section>
  <anypoint-chip removable>
    <iron-icon icon="communication:location-on" slot="icon"></iron-icon>
    Portland
  </anypoint-chip>

  <anypoint-chip removable>
    <iron-icon icon="maps:directions-bike" slot="icon"></iron-icon>
    Biking
  </anypoint-chip>
</section>

Usage

Installation

npm install --save @anypoint-web-components/anypoint-chip

In an html file

<html>
  <head>
    <script type="module">
      import './node_modules/@anypoint-web-components/anypoint-chip/anypoint-chip.js';
    </script>
  </head>
  <body>
    <anypoint-chip></anypoint-chip>
  </body>
</html>

In a LitElement

import { LitElement, html } from 'lit-element';
import '@anypoint-web-components/anypoint-chip/anypoint-chip.js';

class SampleElement extends PolymerElement {
  render() {
    return html`
    <anypoint-chip></anypoint-chip>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/anypoint-web-components/anypoint-chip
cd anypoint-chip
npm install

Running the demo locally

npm start

Running the tests

npm test

Styling

<anypoint-chip> provides the following custom properties for styling:

Custom property | Description | Default ----------------|-------------|---------- --anypoint-chip-background-color | Chip background color | rgba(35, 47, 52, 0.12) --anypoint-chip-focused-background-color | Background color when focused | #D6D6D6 --anypoint-chip-active-background-color | Background color when toggle is active | #cdcdcd --anypoint-chip-icon-color | Color of the icon | #666666 --anypoint-chip-label-color | Color of the label | #232F34 --anypoint-chip-label-focused-color | Color of the when focused | `--anypoint-chip-label-active-color` | Color of the when active | --anypoint-chip-icon-close-color | Color of the close icon | #dfdfdf --anypoint-chip-icon-close-background-color | Background color of the close icon | #666666

<anypoint-chip> provides the following parts:

Part name | Description ----------------|------------- anypoint-chip-container | Styles applied to the chip container anypoint-chip-icon | Styles applied to the icon container anypoint-chip-label | Styles applied to the label container anypoint-chip-remove | Styles applied to the delete icon