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

@m3e/bottom-sheet

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@m3e/bottom-sheet

Bottom Sheet for M3E

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

@m3e/bottom-sheet

The m3e-bottom-sheet component implements a Material 3 bottom sheet with gesture‑driven resizing, detent snapping, and adaptive motion. It behaves as a heavy surface: transitions use non‑bouncy, decelerating motion.

The sheet supports direct manipulation through vertical drag gestures. Movement below an 8px threshold is ignored to ensure reliable tap‑to‑cycle behavior on the handle. Once activated, dragging updates the sheet height with friction near the minimum height to prevent abrupt collapse.

When detents are defined, the sheet snaps to the nearest detent on release. If hideable, downward gestures may dismiss the sheet using either velocity or a small distance threshold below the collapsed detent. When no detents are present, the sheet behaves as a simple open/hidden surface with a bottom‑measured hide threshold.

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/bottom-sheet

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

You also need a module script for @m3e/core due to it being a dependency.

<script type="module" src="/node_modules/@m3e/core/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"
    }
  }
</script>

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

🗂️ Elements

  • m3e-bottom-sheet — A sheet used to show secondary content anchored to the bottom of the screen.
  • m3e-bottom-sheet-trigger — An element for opening bottom sheets by reference (via the for attribute).
  • m3e-bottom-sheet-action — An action element for use within bottom sheets.

🧪 Examples

The following example illustrates a modal bottom sheet with a drag handle, detents, and an action list:

<m3e-button>
  <m3e-bottom-sheet-trigger for="bottomSheet"> Open Bottom Sheet </m3e-bottom-sheet-trigger>
</m3e-button>

<m3e-bottom-sheet id="bottomSheet" modal handle hideable detents="fit half full">
  <m3e-action-list>
    <m3e-list-action autofocus>
      <m3e-bottom-sheet-action>Google Keep</m3e-bottom-sheet-action>
      <span slot="supporting-text">Add to a note</span>
    </m3e-list-action>
    <m3e-list-action>
      <m3e-bottom-sheet-action>Google Docs</m3e-bottom-sheet-action>
      <span slot="supporting-text">Embed in a document</span>
    </m3e-list-action>
  </m3e-action-list>
</m3e-bottom-sheet>

📖 API Reference

🗂️ m3e-bottom-sheet

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

⚙️ Attributes

AttributeTypeDefaultDescription
detentnumber0The zero-based index of the detent the sheet should open to.
detentsstringDetents (discrete height states) the sheet can snap to.
handlebooleanfalseWhether to display a drag handle and enable the top region of the sheet as a gesture surface.
handle-labelstringThe accessible label given to the drag handle.
hideablebooleanfalseWhether the bottom sheet can hide when swiped down.
hide-frictionnumberThe friction coefficient to hide the sheet, or set it to the next closest expanded detent.
modalbooleanfalseWhether the bottom sheet behaves as a modal.
openbooleanfalseWhether the bottom sheet is open.

🧩 Slots

SlotDescription
(default)Renders the content of the sheet.
headerRenders the header of the sheet.

🔔 Events

EventDescription
openingEmitted when the sheet begins to open.
openedEmitted when the sheet has opened.
cancelEmitted when the sheet is cancelled.
closingEmitted when the sheet begins to close.
closedEmitted when the sheet has closed.

🎛️ CSS Custom Properties

PropertyDescription
--m3e-bottom-sheet-widthThe width of the sheet.
--m3e-bottom-sheet-max-widthThe maximum width of the sheet.
--m3e-bottom-sheet-container-colorThe background color of the sheet container.
--m3e-bottom-sheet-elevationThe elevation level when not modal.
--m3e-bottom-sheet-modal-elevationThe elevation level when modal.
--m3e-bottom-sheet-full-elevationThe elevation level when full height.
--m3e-bottom-sheet-z-indexThe z-index of the non-modal sheet.
--m3e-bottom-sheet-minimized-container-shapeThe border radius when minimized.
--m3e-bottom-sheet-container-shapeThe border radius of the sheet container.
--m3e-bottom-sheet-full-container-shapeThe border radius when full height.
--m3e-bottom-sheet-scrim-colorThe color of the scrim overlay.
--m3e-bottom-sheet-scrim-opacityThe opacity of the scrim overlay.
--m3e-bottom-sheet-peek-heightThe visible height when minimized.
--m3e-bottom-sheet-compact-top-spaceThe top space in compact mode.
--m3e-bottom-sheet-top-spaceThe top space in standard mode.
--m3e-bottom-sheet-padding-blockThe vertical padding.
--m3e-bottom-sheet-padding-inlineThe horizontal padding.
--m3e-bottom-sheet-drag-handle-container-heightThe height of the drag handle container.
--m3e-bottom-sheet-handle-widthThe width of the drag handle.
--m3e-bottom-sheet-handle-heightThe height of the drag handle.
--m3e-bottom-sheet-handle-shapeThe border radius of the handle.
--m3e-bottom-sheet-handle-colorThe color of the drag handle.
--m3e-bottom-sheet-handle-focus-ring-offsetThe offset of the focus ring around the handle.
--m3e-bottom-sheet-colorThe foreground (text) color used inside the sheet.
--m3e-bottom-sheet-content-font-sizeFont size for sheet content.
--m3e-bottom-sheet-content-font-weightFont weight for sheet content.
--m3e-bottom-sheet-content-line-heightLine height for sheet content.
--m3e-bottom-sheet-content-trackingLetter spacing (tracking) for sheet content.
--m3e-bottom-sheet-header-font-sizeFont size for the sheet header.
--m3e-bottom-sheet-header-font-weightFont weight for the sheet header.
--m3e-bottom-sheet-header-line-heightLine height for the sheet header.
--m3e-bottom-sheet-header-trackingLetter spacing (tracking) for the sheet header.

🗂️ m3e-bottom-sheet-trigger

An element for opening bottom sheets by reference (via the for attribute).

⚙️ Attributes

AttributeTypeDefaultDescription
detentnumber | undefinedundefinedThe zero-based index of the detent the sheet should open to.
secondarybooleanfalseMarks this trigger as a secondary trigger for accessibility. Secondary triggers do not receive ARIA ownership.

🧩 Slots

SlotDescription
(default)Renders the content of the trigger.

🗂️ m3e-bottom-sheet-action

An action element for closing a parent bottom sheet when activated.

🧩 Slots

SlotDescription
(default)Renders the content of the action.

🤝 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