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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@3mo/sheet

v0.1.5

Published

A web component for modal sheets anchored to any screen edge with swipe-to-dismiss, built on the native dialog element.

Readme

Sheet

A web component for modal sheets anchored to any screen edge with swipe-to-dismiss, built on the native dialog element.

npm Documentation

A modal panel anchored to an edge of the viewport, closed by Escape, the backdrop, its handle or a swipe.

Installation

npm install @3mo/sheet
import '@3mo/sheet'

Usage

<mo-button type='outlined' startIcon='share' @click=${() => setOpen(true)}>Share</mo-button>
<mo-sheet placement='block-end' label='Share' ?open=${open} @openChange=${(event: CustomEvent<boolean>) => setOpen(event.detail)}>
	<mo-list style='padding-block: 8px'>
		<mo-list-item icon='insert_link'>Copy link</mo-list-item>
		<mo-list-item icon='mail'>Send by email</mo-list-item>
		<mo-list-item icon='download'>Download</mo-list-item>
	</mo-list>
</mo-sheet>

Examples

  • Placements — A sheet comes in from the edge it is anchored to.
  • Scrollable — Content taller than the sheet scrolls inside it, while the handle stays put.
  • Prevented Close — Cancelling requestClose keeps the sheet open.
  • Nested Popover — Menus and popovers opened from the sheet render above it, and the field marked autofocus takes the focus as it opens.
  • Custom Properties — --mo-sheet-size sets the width of a side sheet, and the corners, the backdrop and the motion have custom properties too.
  • Parts — The panel, handle and content parts can be styled from outside.

Accessibility

A native modal dialog, so the page behind it is inert. It is named by label, the element with autofocus inside takes focus as it opens, and its handle is a button named "Close". Escape fires the cancelable requestClose and closes.

API

mo-sheet

Properties

| Name | Attribute | Type | Default | Description | | --- | --- | --- | --- | --- | | open | open | boolean | false | Whether the sheet is open. | | placement | placement | SheetPlacement | "block-end" | The edge the sheet is anchored to: block-end (default), block-start, inline-start or inline-end. | | label | label | string \| undefined | | The accessible name of the sheet. |

Events

| Name | Detail | Description | | --- | --- | --- | | openChange | boolean | Dispatched with the new state whenever the sheet opens or closes. | | requestClose | | Dispatched with the source before the sheet closes itself. Cancelable to keep the sheet open. |

Slots

| Name | Description | | --- | --- | | (default) | Content of the sheet. | | handle | The grabber handle, replacing the default one. Only rendered for block placements. | | top-layer | Hosts elements which must stay interactive while the rest of the page is made inert by the sheet. |

CSS custom properties

| Name | Description | | --- | --- | | --mo-sheet-size | The panel's size on its anchored axis: the maximum height for block placements, the width for inline placements. | | --mo-sheet-scrim | The backdrop color. Defaults to the theme's scrim color. | | --mo-sheet-border-radius | The corner radius of the panel's free edges. | | --mo-sheet-duration | How long the sheet takes to come and go. Defaults to 250ms. | | --mo-sheet-easing | The easing of that motion. Defaults to Material's emphasized decelerate. |

CSS parts

| Name | Description | | --- | --- | | dialog | The native dialog element, filling the viewport. Its ::backdrop carries the scrim. | | panel | The visible sheet surface. | | handle | The default grabber handle. | | content | The scrollable wrapper around the default slot. |

Links

License

MIT © 3MO GmbH