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

@m3e/card

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@m3e/card

Card for M3E

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

@m3e/card

The m3e-card component is a flexible, expressive container for presenting a unified subject—text, media, and actions—on a visually distinct surface. It supports multiple appearance variants via the variant attribute: filled (default, for solid emphasis), outlined (for subtle framing with a border), and elevated (for depth and motion with shadow elevation).

Cards can be made actionable, responding to user interaction when the actionable attribute is set, and can be presented inline with surrounding content using the inline attribute.

It supports both vertical and horizontal layouts through the orientation attribute. Content organization is enabled via dedicated slots for header, content, actions, and footer, or developers can use the default slot for custom layouts.

The component provides dynamic elevation, adaptive shape, and expressive color theming, and responds to interaction states (hover, focus, press, disabled) with smooth motion and visual feedback, ensuring clarity, accessibility, and a cohesive user experience in accordance with Material Design 3 guidelines.

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/card

💻 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/card, 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/card/dist/html-custom-data.json"],
  "css.customData": ["./node_modules/@m3e/card/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/card/dist/index.js"></script>

In addition, you must use an import map to include 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"
    }
  }
</script>

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

🗂️ Elements

  • m3e-card — A content container for text, images (or other media), and actions in the context of a single subject.

🧪 Examples

The following example illustrates each of the dedicated slots of a card.

<m3e-card>
  <div slot="header">Header section</div>
  <div slot="content">Content section</div>
  <div slot="actions">Actions section</div>
  <div slot="footer">Footer section</div>
</m3e-card>

📖 API Reference

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

⚙️ Attributes

AttributeTypeDefaultDescription
actionablebooleanfalseWhether the card is "actionable" and will respond to use interaction.
inlinebooleanfalseWhether to present the card inline with surrounding content.
orientation"horizontal" | "vertical""vertical"The orientation of the card.
variant"filled" | "outlined" | "elevated""filled"The appearance variant of the card.

🧩 Slots

SlotDescription
(default)Renders content without padding.
headerRenders the header section.
contentRenders padded content.
actionsRenders interactive controls.
footerRenders footer content.

🎛️ CSS Custom Properties

The m3e-card element supports extensive theming via scoped CSS custom properties. These properties enable fine-grained control over layout, shape, elevation, color, and interaction states across all appearance variants.

🧱 Global Properties

PropertyDescription
--m3e-card-paddingInternal spacing for all slotted regions.
--m3e-card-shapeCorner radius of the card container.

🟫 Filled Variant

Base
PropertyDescription
--m3e-filled-card-text-colorForeground color for text content.
--m3e-filled-card-container-colorBackground color of the container.
--m3e-filled-card-container-elevationElevation level of the container.
Disabled
PropertyDescription
--m3e-filled-card-disabled-text-colorText color when disabled.
--m3e-filled-card-disabled-text-opacityOpacity applied to text when disabled.
--m3e-filled-card-disabled-container-colorBackground color when disabled.
--m3e-filled-card-disabled-container-elevationElevation level when disabled.
--m3e-filled-card-disabled-container-elevation-colorShadow color when disabled.
--m3e-filled-card-disabled-container-elevation-opacityShadow opacity when disabled.
--m3e-filled-card-disabled-container-opacityOverall container opacity when disabled.
Hover
PropertyDescription
--m3e-filled-card-hover-text-colorText color on hover.
--m3e-filled-card-hover-state-layer-colorState layer color on hover.
--m3e-filled-card-hover-state-layer-opacityState layer opacity on hover.
--m3e-filled-card-hover-container-elevationElevation level on hover.
Focus
PropertyDescription
--m3e-filled-card-focus-text-colorText color on focus.
--m3e-filled-card-focus-state-layer-colorState layer color on focus.
--m3e-filled-card-focus-state-layer-opacityState layer opacity on focus.
--m3e-filled-card-focus-container-elevationElevation level on focus.
Pressed
PropertyDescription
--m3e-filled-card-pressed-text-colorText color on press.
--m3e-filled-card-pressed-state-layer-colorState layer color on press.
--m3e-filled-card-pressed-state-layer-opacityState layer opacity on press.
--m3e-filled-card-pressed-container-elevationElevation level on press.

🟪 Elevated Variant

Base
PropertyDescription
--m3e-elevated-card-text-colorForeground color for text content.
--m3e-elevated-card-container-colorBackground color of the container.
--m3e-elevated-card-container-elevationElevation level of the container.
Disabled
PropertyDescription
--m3e-elevated-card-disabled-text-colorText color when disabled.
--m3e-elevated-card-disabled-text-opacityOpacity applied to text when disabled.
--m3e-elevated-card-disabled-container-colorBackground color when disabled.
--m3e-elevated-card-disabled-container-elevationElevation level when disabled.
--m3e-elevated-card-disabled-container-elevation-colorShadow color when disabled.
--m3e-elevated-card-disabled-container-elevation-opacityShadow opacity when disabled.
--m3e-elevated-card-disabled-container-opacityOverall container opacity when disabled.
Hover
PropertyDescription
--m3e-elevated-card-hover-text-colorText color on hover.
--m3e-elevated-card-hover-state-layer-colorState layer color on hover.
--m3e-elevated-card-hover-state-layer-opacityState layer opacity on hover.
--m3e-elevated-card-hover-container-elevationElevation level on hover.
Focus
PropertyDescription
--m3e-elevated-card-focus-text-colorText color on focus.
--m3e-elevated-card-focus-state-layer-colorState layer color on focus.
--m3e-elevated-card-focus-state-layer-opacityState layer opacity on focus.
--m3e-elevated-card-focus-container-elevationElevation level on focus.
Pressed
PropertyDescription
--m3e-elevated-card-pressed-text-colorText color on press.
--m3e-elevated-card-pressed-state-layer-colorState layer color on press.
--m3e-elevated-card-pressed-state-layer-opacityState layer opacity on press.
--m3e-elevated-card-pressed-container-elevationElevation level on press.

🟦 Outlined Variant

Base
PropertyDescription
--m3e-outlined-card-text-colorForeground color for text content.
--m3e-outlined-card-container-elevationElevation level of the container.
--m3e-outlined-card-outline-colorBorder color of the card.
--m3e-outlined-card-outline-thicknessBorder thickness of the card.
Disabled
PropertyDescription
--m3e-outlined-card-disabled-text-colorText color when disabled.
--m3e-outlined-card-disabled-text-opacityOpacity applied to text when disabled.
--m3e-outlined-card-disabled-container-elevationElevation level when disabled.
--m3e-outlined-card-disabled-container-elevation-colorShadow color when disabled.
--m3e-outlined-card-disabled-container-elevation-opacityShadow opacity when disabled.
--m3e-outlined-card-disabled-outline-colorBorder color when disabled.
--m3e-outlined-card-disabled-outline-opacityBorder opacity when disabled.
Hover
PropertyDescription
--m3e-outlined-card-hover-text-colorText color on hover.
--m3e-outlined-card-hover-state-layer-colorState layer color on hover.
--m3e-outlined-card-hover-state-layer-opacityState layer opacity on hover.
--m3e-outlined-card-hover-container-elevationElevation level on hover.
--m3e-outlined-card-hover-outline-colorBorder color on hover.
Focus
PropertyDescription
--m3e-outlined-card-focus-text-colorText color on focus.
--m3e-outlined-card-focus-state-layer-colorState layer color on focus.
--m3e-outlined-card-focus-state-layer-opacityState layer opacity on focus.
--m3e-outlined-card-focus-container-elevationElevation level on focus.
--m3e-outlined-card-focus-outline-colorBorder color on focus.
Pressed
PropertyDescription
--m3e-outlined-card-pressed-text-colorText color on press.
--m3e-outlined-card-pressed-state-layer-colorState layer color on press.
--m3e-outlined-card-pressed-state-layer-opacityState layer opacity on press.
--m3e-outlined-card-pressed-container-elevationElevation level on press.
--m3e-outlined-card-pressed-outline-colorBorder color on press.

🤝 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