New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@m3e/chips

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@m3e/chips

Chips for M3E

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

@m3e/chips

The @m3e/chips package provides expressive, accessible chip components for actions, input, filtering, and suggestions, each supporting two appearance variants—outlined and elevated. Use outlined for lightweight, unobtrusive chips such as tags or filters, and elevated for chips that require stronger visual affordance, like assist actions or selected states. These variants help convey interaction weight, visual hierarchy, and contextual emphasis across static and interactive use cases.

This package is part of M3E monorepo, a unified suite of Material 3 web components. Explore the docs to see them in action.

📦 Installation

npm install @m3e/chips

💻 Editor Integration

This package includes a Custom Elements Manifest to support enhanced editor tooling and developer experience.

Visual Studio Code

To enable autocomplete and hover documentation for @m3e/chips, install the Custom Elements Manifest Language Server extension. It will automatically detect the manifest bundled with this package and surface tag names, attributes, slots, and events in supported files.

Alternately, you can explicitly reference the html-custom-data.json and css-custom-data.json in your workspace settings:

{
  "html.customData": ["./node_modules/@m3e/chips/dist/html-custom-data.json"],
  "css.customData": ["./node_modules/@m3e/chips/dist/css-custom-data.json"]
}

🚀 Native Module Support

This package uses JavaScript Modules. To use it directly in a browser without a bundler, use a module script similar to the following.

<script type="module" src="/node_modules/@m3e/chips/dist/index.js"></script>

You also need a module script for @m3e/icon-button and m3e/form-field due to being a dependency.

<script type="module" src="/node_modules/@m3e/icon-button/dist/index.js"></script>
<script type="module" src="/node_modules/@m3e/form-field/dist/index.js"></script>

In addition, you must use an import map to include additional dependencies.

<script type="importmap">
  {
    "imports": {
      "lit": "https://cdn.jsdelivr.net/npm/lit@3.3.0/+esm",
      "@m3e/core": "/node_modules/@m3e/core/dist/index.js",
      "@m3e/core/a11y": "/node_modules/@m3e/core/dist/a11y.js",
      "@m3e/core/bidi": "/node_modules/@m3e/core/dist/bidi.js"
    }
  }
</script>

For production, use index.min.js, a11y.min.js, and bidi.min.js for faster load times.

🗂️ Elements

  • m3e-chip — A non-interactive chip used to convey small pieces of information.
  • m3e-chip-set — A container used to organize chips into a cohesive unit.
  • m3e-assist-chip — A chip users interact with to perform a smart or automated action that can span multiple applications.
  • m3e-input-chip — A chip which represents a discrete piece of information entered by a user.
  • m3e-input-chip-set — A container that transforms user input into a cohesive set of interactive chips, supporting entry, editing, and removal of discrete values.
  • m3e-filter-chip — A chip users interact with to select/deselect options.
  • m3e-filter-chip-set — A container that organizes filter chips into a cohesive group, enabling selection and deselection of values used to refine content or trigger contextual behavior.
  • m3e-suggestion-chip — A chip used to help narrow a user's intent by presenting dynamically generated suggestions, such as suggested responses or search filters.

🧪 Examples

🗂️ Chip

The following example illustrates use of the m3e-chip and m3e-chip-set components to present non-interactive chips.

<m3e-chip-set>
  <m3e-chip><m3e-icon slot="icon" name="palette"></m3e-icon>Design</m3e-chip>
  <m3e-chip><m3e-icon slot="icon" name="accessibility_new"></m3e-icon>Accessibility</m3e-chip>
  <m3e-chip><m3e-icon slot="icon" name="motion_photos_on"></m3e-icon>Motion</m3e-chip>
  <m3e-chip><m3e-icon slot="icon" name="description"></m3e-icon>Documentation</m3e-chip>
</m3e-chip-set>

🗂️ Assist Chip

The following example illustrates use of the m3e-assist-chip. In this example, multiple chips are nested inside a m3e-chip-set container to create a cohesive set of chips. The container is given the ARIA role="group" to convey to assistive technologies that the chips are part of a related set of element.

<m3e-chip-set role="group" aria-label="Quick actions">
  <m3e-assist-chip><m3e-icon slot="icon" name="edit"></m3e-icon>Edit</m3e-assist-chip>
  <m3e-assist-chip><m3e-icon slot="icon" name="delete"></m3e-icon>Delete</m3e-assist-chip>
  <m3e-assist-chip><m3e-icon slot="icon" name="content_copy"></m3e-icon>Copy</m3e-assist-chip>
  <m3e-assist-chip><m3e-icon slot="icon" name="share"></m3e-icon>Share</m3e-assist-chip>
</m3e-chip-set>

🗂️ Input Chip

The following example illustrates the use of the m3e-input-chip-set inside a m3e-form-field. In this example, the input slot specifies the input element used to add input chips and the field label's for attribute targets the input element to provide an accessible label.

<m3e-form-field>
  <label slot="label" for="keywords">Keywords</label>
  <m3e-input-chip-set aria-label="Enter keywords">
    <input id="keywords" slot="input" placeholder="New keyword..." />
  </m3e-input-chip-set>
</m3e-form-field>

🗂️ Filter Chip

  • The following example illustrates a single-select m3e-filter-chip-set containing multiple m3e-filter-chip components that allow a user to choose an option. You can use the multi attribute to enable multiselect.
<m3e-filter-chip-set aria-label="Filter by topic">
  <m3e-filter-chip><m3e-icon slot="icon" name="palette"></m3e-icon>Design</m3e-filter-chip>
  <m3e-filter-chip><m3e-icon slot="icon" name="accessibility_new"></m3e-icon>Accessibility</m3e-filter-chip>
  <m3e-filter-chip><m3e-icon slot="icon" name="motion_photos_on"></m3e-icon>Motion</m3e-filter-chip>
  <m3e-filter-chip><m3e-icon slot="icon" name="description"></m3e-icon>Documentation</m3e-filter-chip>
</m3e-filter-chip-set>

🗂️ Suggestion Chip

The following example illustrates use of the m3e-suggestion-chip. In this example, multiple chips are nested inside a m3e-chip-set container to create a cohesive set of chips. The container is given the ARIA role="group" to convey to assistive technologies that the chips are part of a related set of element.

<m3e-chip-set role="group" aria-label="Suggested replies">
  <m3e-suggestion-chip>Sounds good!</m3e-suggestion-chip>
  <m3e-suggestion-chip>Can you clarify?</m3e-suggestion-chip>
  <m3e-suggestion-chip>Let's do it.</m3e-suggestion-chip>
  <m3e-suggestion-chip>Maybe later.</m3e-suggestion-chip>
</m3e-chip-set>

📖 API Reference

🗂️ Chip

This section details the attributes, slots, and CSS custom properties available for the m3e-chip component.

⚙️ Attributes

AttributeTypeDefaultDescription
valuestringThe value of the chip.
variant"outlined" | "elevated""outlined"The appearance variant.

🧩 Slots

SlotDescription
(default)Renders the label of the chip.
iconRenders an icon before the chip's label.
trailing-iconRenders an icon after the chip's label.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-container-shapeBorder radius of the chip container
--m3e-chip-container-heightBase height of the chip container before density adjustment
--m3e-chip-label-text-font-sizeFont size of the chip label text
--m3e-chip-label-text-font-weightFont weight of the chip label text
--m3e-chip-label-text-line-heightLine height of the chip label text
--m3e-chip-label-text-trackingLetter spacing of the chip label text
--m3e-chip-label-text-colorLabel text color in default state
--m3e-chip-icon-colorIcon color in default state
--m3e-chip-icon-sizeFont size of leading/trailing icons
--m3e-chip-spacingHorizontal gap between chip content elements
--m3e-chip-padding-startDefault start padding when no icon is present
--m3e-chip-padding-endDefault end padding when no trailing icon is present
--m3e-chip-with-icon-padding-startStart padding when leading icon is present
--m3e-chip-with-icon-padding-endEnd padding when trailing icon is present
--m3e-elevated-chip-container-colorBackground color for elevated variant
--m3e-elevated-chip-elevationElevation level for elevated variant
--m3e-elevated-chip-hover-elevationElevation level on hover
--m3e-outlined-chip-outline-thicknessOutline thickness for outlined variant
--m3e-outlined-chip-outline-colorOutline color for outlined variant

🗂️ Chip Set

This section details the attributes, slots, and CSS custom properties available for the m3e-chip-set component.

⚙️ Attributes

AttributeTypeDefaultDescription
verticalbooleanfalseWhether chips are stacked vertically.

🧩 Slots

SlotDescription
(default)Renders the chips of the set.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-set-spacingThe spacing (gap) between chips.

🗂️ Assist Chip

This section details the attributes, slots, and CSS custom properties available for the m3e-assist-chip component.

⚙️ Attributes

AttributeTypeDefaultDescription
disabledbooleanfalseWhether the chip is disabled.
disabled-interactivebooleanfalseWhether the chip is disabled and interactive.
downloadstringDownload attribute for link button.
hrefstringURL for the link button.
namestringName for form submission.
relstringRelationship for the link button.
targetstringTarget for the link button.
typestringType of the element.
valuestringThe value of the chip.
variant"outlined" | "elevated""outlined"The appearance variant.

🧩 Slots

SlotDescription
(default)Renders the label of the chip.
iconRenders an icon before the chip's label.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-container-shapeBorder radius of the chip container
--m3e-chip-container-heightBase height of the chip container before density adjustment
--m3e-chip-label-text-font-sizeFont size of the chip label text
--m3e-chip-label-text-font-weightFont weight of the chip label text
--m3e-chip-label-text-line-heightLine height of the chip label text
--m3e-chip-label-text-trackingLetter spacing of the chip label text
--m3e-chip-label-text-colorLabel text color in default state
--m3e-chip-icon-colorIcon color in default state
--m3e-chip-icon-sizeFont size of leading/trailing icons
--m3e-chip-spacingHorizontal gap between chip content elements
--m3e-chip-padding-startDefault start padding when no icon is present
--m3e-chip-padding-endDefault end padding when no trailing icon is present
--m3e-chip-with-icon-padding-startStart padding when leading icon is present
--m3e-chip-with-icon-padding-endEnd padding when trailing icon is present
--m3e-chip-disabled-label-text-colorBase color for disabled label text
--m3e-chip-disabled-label-text-opacityOpacity applied to disabled label text
--m3e-chip-disabled-icon-colorBase color for disabled icons
--m3e-chip-disabled-icon-opacityOpacity applied to disabled icons
--m3e-elevated-chip-container-colorBackground color for elevated variant
--m3e-elevated-chip-elevationElevation level for elevated variant
--m3e-elevated-chip-hover-elevationElevation level on hover
--m3e-elevated-chip-disabled-container-colorBackground color for disabled elevated variant
--m3e-elevated-chip-disabled-container-opacityOpacity applied to disabled elevated background
--m3e-elevated-chip-disabled-elevationElevation level for disabled elevated variant
--m3e-outlined-chip-outline-thicknessOutline thickness for outlined variant
--m3e-outlined-chip-outline-colorOutline color for outlined variant
--m3e-outlined-chip-disabled-outline-colorOutline color for disabled outlined variant
--m3e-outlined-chip-disabled-outline-opacityOpacity applied to disabled outline

🗂️ Input Chip

This section details the attributes, events, slots, and CSS custom properties available for the m3e-input-chip component.

⚙️ Attributes

AttributeTypeDefaultDescription
disabledbooleanfalseWhether the chip is disabled.
disabled-interactivebooleanfalseWhether the chip is disabled and interactive.
removablebooleanfalseWhether the chip is removable.
remove-labelstring"Remove"Accessible label for the remove button.
valuestringThe value of the chip.
variant"outlined" | "elevated""outlined"The appearance variant.

🧩 Slots

SlotDescription
(default)Renders the label of the chip.
avatarRenders an avatar before the chip's label.
iconRenders an icon before the chip's label.
remove-iconRenders the icon for the remove button.

🔔 Events

EventDescription
removeEmitted when the remove button is clicked or DELETE or BACKSPACE is pressed.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-container-shapeBorder radius of the chip container
--m3e-chip-container-heightBase height of the chip container before density adjustment
--m3e-chip-label-text-font-sizeFont size of the chip label text
--m3e-chip-label-text-font-weightFont weight of the chip label text
--m3e-chip-label-text-line-heightLine height of the chip label text
--m3e-chip-label-text-trackingLetter spacing of the chip label text
--m3e-chip-label-text-colorLabel text color in default state
--m3e-chip-icon-colorIcon color in default state
--m3e-chip-icon-sizeFont size of leading/trailing icons
--m3e-chip-spacingHorizontal gap between chip content elements
--m3e-chip-padding-startDefault start padding when no icon is present
--m3e-chip-padding-endDefault end padding when no trailing icon is present
--m3e-chip-with-icon-padding-startStart padding when leading icon is present
--m3e-chip-with-icon-padding-endEnd padding when trailing icon is present
--m3e-chip-disabled-label-text-colorBase color for disabled label text
--m3e-chip-disabled-label-text-opacityOpacity applied to disabled label text
--m3e-chip-disabled-icon-colorBase color for disabled icons
--m3e-chip-disabled-icon-opacityOpacity applied to disabled icons
--m3e-elevated-chip-container-colorBackground color for elevated variant
--m3e-elevated-chip-elevationElevation level for elevated variant
--m3e-elevated-chip-hover-elevationElevation level on hover
--m3e-elevated-chip-disabled-container-colorBackground color for disabled elevated variant
--m3e-elevated-chip-disabled-container-opacityOpacity applied to disabled elevated background
--m3e-elevated-chip-disabled-elevationElevation level for disabled elevated variant
--m3e-outlined-chip-outline-thicknessOutline thickness for outlined variant
--m3e-outlined-chip-outline-colorOutline color for outlined variant
--m3e-outlined-chip-disabled-outline-colorOutline color for disabled outlined variant
--m3e-outlined-chip-disabled-outline-opacityOpacity applied to disabled outline
--m3e-chip-avatar-sizeFont size of the avatar slot content
--m3e-chip-disabled-avatar-opacityOpacity applied to the avatar when disabled
--m3e-chip-with-avatar-padding-startStart padding when an avatar is present

🗂️ Input Chip Set

This section details the attributes, events, slots, and CSS custom properties available for the m3e-input-chip-set component.

⚙️ Attributes

AttributeTypeDefaultDescription
disabledbooleanfalseWhether the element is disabled.
namestringThe name that identifies the element when submitting the associated form.
requiredbooleanfalseWhether a value is required for the element.
verticalbooleanfalseWhether chips are stacked vertically.

🔔 Events

EventDescription
changeEmitted when a chip is added to, or removed from, the set.

🧩 Slots

SlotDescription
(default)Renders the chips of the set.
inputRenders the input element used to add new chips to the set.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-set-spacingThe spacing (gap) between chips.

🗂️ Filter Chip

This section details the attributes, events, slots, and CSS custom properties available for the m3e-filter-chip component.

⚙️ Attributes

AttributeTypeDefaultDescription
disabledbooleanfalseWhether the chip is disabled.
disabled-interactivebooleanfalseWhether the chip is disabled and interactive.
selectedbooleanfalseWhether the chip is selected.
valuestringThe value of the chip.
variant"outlined" | "elevated""outlined"The appearance variant.

🧩 Slots

SlotDescription
(default)Renders the label of the chip.
iconRenders an icon before the chip's label.
trailing-iconRenders an icon after the chip's label.

🔔 Events

EventDescription
inputEmitted when the selected state changes.
changeEmitted when the selected state changes.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-container-shapeBorder radius of the chip container
--m3e-chip-container-heightBase height of the chip container before density adjustment
--m3e-chip-label-text-font-sizeFont size of the chip label text
--m3e-chip-label-text-font-weightFont weight of the chip label text
--m3e-chip-label-text-line-heightLine height of the chip label text
--m3e-chip-label-text-trackingLetter spacing of the chip label text
--m3e-chip-icon-sizeFont size of leading/trailing icons
--m3e-chip-spacingHorizontal gap between chip content elements
--m3e-chip-padding-startDefault start padding when no icon is present
--m3e-chip-padding-endDefault end padding when no trailing icon is present
--m3e-chip-with-icon-padding-startStart padding when leading icon is present
--m3e-chip-with-icon-padding-endEnd padding when trailing icon is present
--m3e-chip-disabled-label-text-colorBase color for disabled label text
--m3e-chip-disabled-label-text-opacityOpacity applied to disabled label text
--m3e-chip-disabled-icon-colorBase color for disabled icons
--m3e-chip-disabled-icon-opacityOpacity applied to disabled icons
--m3e-elevated-chip-container-colorBackground color for elevated variant
--m3e-elevated-chip-elevationElevation level for elevated variant
--m3e-elevated-chip-hover-elevationElevation level on hover
--m3e-elevated-chip-disabled-container-colorBackground color for disabled elevated variant
--m3e-elevated-chip-disabled-container-opacityOpacity applied to disabled elevated background
--m3e-elevated-chip-disabled-elevationElevation level for disabled elevated variant
--m3e-outlined-chip-outline-thicknessOutline thickness for outlined variant
--m3e-outlined-chip-outline-colorOutline color for outlined variant
--m3e-outlined-chip-disabled-outline-colorOutline color for disabled outlined variant
--m3e-outlined-chip-disabled-outline-opacityOpacity applied to disabled outline
--m3e-chip-selected-outline-thicknessOutline thickness for selected state
--m3e-chip-selected-label-text-colorText color in selected state
--m3e-chip-selected-container-colorBackground color in selected state
--m3e-chip-selected-container-hover-colorHover state layer color in selected state
--m3e-chip-selected-container-focus-colorFocus state layer color in selected state
--m3e-chip-selected-hover-elevationElevation on hover in selected state
--m3e-chip-selected-ripple-colorRipple color in selected state
--m3e-chip-selected-state-layer-focus-colorFocus state layer color in selected state
--m3e-chip-selected-state-layer-hover-colorHover state layer color in selected state
--m3e-chip-selected-leading-icon-colorLeading icon color in selected state
--m3e-chip-selected-trailing-icon-colorTrailing icon color in selected state
--m3e-chip-unselected-label-text-colorText color in unselected state
--m3e-chip-unselected-ripple-colorRipple color in unselected state
--m3e-chip-unselected-state-layer-focus-colorFocus state layer color in unselected state
--m3e-chip-unselected-state-layer-hover-colorHover state layer color in unselected state
--m3e-chip-unselected-leading-icon-colorLeading icon color in unselected state
--m3e-chip-unselected-trailing-icon-colorTrailing icon color in unselected state

🗂️ Filter Chip Set

This section details the attributes, events, slots, and CSS custom properties available for the m3e-filter-chip-set component.

⚙️ Attributes

AttributeTypeDefaultDescription
disabledbooleanfalseWhether the element is disabled.
hide-selection-indicatorbooleanfalseWhether to hide the selection indicator.
multibooleanfalseWhether multiple chips can be selected.
namestringThe name that identifies the element when submitting the associated form.
verticalbooleanfalseWhether chips are stacked vertically.

🔔 Events

EventDescription
inputEmitted when the selected state of a chip changes.
changeEmitted when the selected state of a chip changes.

🧩 Slots

SlotDescription
(default)Renders the chips of the set.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-set-spacingThe spacing (gap) between chips.

🗂️ Suggestion Chip

This section details the attributes, slots, and CSS custom properties available for the m3e-suggestion-chip component.

⚙️ Attributes

AttributeTypeDefaultDescription
disabledbooleanfalseWhether the chip is disabled.
disabled-interactivebooleanfalseWhether the chip is disabled and interactive.
downloadstringDownload attribute for link button.
hrefstringURL for the link button.
namestringName for form submission.
relstringRelationship for the link button.
targetstringTarget for the link button.
typestringType of the element.
valuestringThe value of the chip.
variant"outlined" | "elevated""outlined"The appearance variant.

🧩 Slots

SlotDescription
(default)Renders the label of the chip.
iconRenders an icon before the chip's label.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-chip-container-shapeBorder radius of the chip container
--m3e-chip-container-heightBase height of the chip container before density adjustment
--m3e-chip-label-text-font-sizeFont size of the chip label text
--m3e-chip-label-text-font-weightFont weight of the chip label text
--m3e-chip-label-text-line-heightLine height of the chip label text
--m3e-chip-label-text-trackingLetter spacing of the chip label text
--m3e-chip-label-text-colorLabel text color in default state
--m3e-chip-icon-colorIcon color in default state
--m3e-chip-icon-sizeFont size of leading/trailing icons
--m3e-chip-spacingHorizontal gap between chip content elements
--m3e-chip-padding-startDefault start padding when no icon is present
--m3e-chip-padding-endDefault end padding when no trailing icon is present
--m3e-chip-with-icon-padding-startStart padding when leading icon is present
--m3e-chip-with-icon-padding-endEnd padding when trailing icon is present
--m3e-chip-disabled-label-text-colorBase color for disabled label text
--m3e-chip-disabled-label-text-opacityOpacity applied to disabled label text
--m3e-chip-disabled-icon-colorBase color for disabled icons
--m3e-chip-disabled-icon-opacityOpacity applied to disabled icons
--m3e-elevated-chip-container-colorBackground color for elevated variant
--m3e-elevated-chip-elevationElevation level for elevated variant
--m3e-elevated-chip-hover-elevationElevation level on hover
--m3e-elevated-chip-disabled-container-colorBackground color for disabled elevated variant
--m3e-elevated-chip-disabled-container-opacityOpacity applied to disabled elevated background
--m3e-elevated-chip-disabled-elevationElevation level for disabled elevated variant
--m3e-outlined-chip-outline-thicknessOutline thickness for outlined variant
--m3e-outlined-chip-outline-colorOutline color for outlined variant
--m3e-outlined-chip-disabled-outline-colorOutline color for disabled outlined variant
--m3e-outlined-chip-disabled-outline-opacityOpacity applied to disabled outline

🤝 Contributing

See the root monorepo CONTRIBUTING.md for guidelines on contributing to this package.

📄 License

This package is licensed under the MIT License.

Keywords

material design

FAQs

Package last updated on 20 Feb 2026

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