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

@material/chips

Package Overview
Dependencies
Maintainers
1
Versions
1672
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/chips

The Material Components for the Web chips component

  • 0.30.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
594K
decreased by-15.31%
Maintainers
1
Weekly downloads
 
Created
Source

Chips

Chips are compact elements that allow users to enter information, select a choice, filter content, or trigger an action.

Design & API Documentation

  • Material Design guidelines: Chips
  • Demo

Installation

npm install --save @material/chips

Usage

HTML Structure

<div class="mdc-chip-set">
  <div class="mdc-chip">
    <div class="mdc-chip__text">Chip content</div>
  </div>
  <div class="mdc-chip">
    <div class="mdc-chip__text">Chip content</div>
  </div>
  <div class="mdc-chip">
    <div class="mdc-chip__text">Chip content</div>
  </div>
</div>

CSS Classes

CSS ClassDescription
mdc-chipMandatory.
mdc-chip__textMandatory. Indicates the text content of the chip.
mdc-chip-setMandatory. Indicates the set that the chip belongs to.

MDCChip and MDCChipSet

The MDC Chips module is comprised of two JavaScript classes:

  • MDCChip defines the behavior of a single chip
  • MDCChipSet defines the behavior of chips within a specific set. For example, chips in an entry chip set behave differently from those in a filter chip set.

To use the MDCChip and MDCChipSet classes, import both classes from @material/chips.

MDCChip
PropertyValue TypeDescription
rippleMDCRippleThe MDCRipple instance for the root element that MDCChip initializes
MDCChipSet
PropertyValue TypeDescription
chipsArray<MDCChip>An array of the MDCChip objects that represent chips in the set

Adapters: MDCChipAdapter and MDCChipSetAdapter

MDCChipAdapter
Method SignatureDescription
registerInteractionHandler(evtType: string, handler: EventListener) => voidRegisters an event listener on the root element
deregisterInteractionHandler(evtType: string, handler: EventListener) => voidDeregisters an event listener on the root element
notifyInteraction() => voidEmits a custom event "MDCChip:interaction" denoting the chip has been interacted with, which bubbles to the parent mdc-chip-set element
MDCChipSetAdapter
Method SignatureDescription
hasClass(className: string) => booleanReturns whether the chip set element has the given class

Foundations: MDCChipFoundation and MDCChipSetFoundation

MDCChipFoundation

None yet, coming soon.

MDCChipSetFoundation

None yet, coming soon.

Keywords

FAQs

Package last updated on 05 Feb 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