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

@neovici/cosmoz-drawer-layout

v1.0.1

Published

A drawer layout web component with responsive side/overlay modes

Readme

@neovici/cosmoz-drawer-layout

A drawer layout web component with responsive side/overlay modes.

Installation

npm install @neovici/cosmoz-drawer-layout

Usage

Import

// Both components from the main entry point
import '@neovici/cosmoz-drawer-layout';

// Or import individually
import '@neovici/cosmoz-drawer-layout/cosmoz-drawer-layout';
import '@neovici/cosmoz-drawer-layout/cosmoz-side-panel';

Basic

<cosmoz-drawer-layout breakpoint="1024">
	<cosmoz-side-panel slot="left">
		<p>Left drawer content</p>
	</cosmoz-side-panel>
	<p>Main content</p>
	<cosmoz-side-panel slot="right">
		<p>Right drawer content</p>
	</cosmoz-side-panel>
</cosmoz-drawer-layout>

cosmoz-drawer-layout

A responsive layout with left and right drawer slots that switch between side mode (drawers always visible) and overlay mode (drawers slide in/out with backdrop).

Attributes

| Attribute | Type | Default | Description | | ------------------- | -------- | ------- | -------------------------------------------------------------------- | | breakpoint | string | 1460 | Viewport width (px) for side/overlay switch. 0 = always side mode. | | left-drawer-open | boolean | — | Opens the left drawer (overlay mode). | | right-drawer-open | boolean | — | Opens the right drawer (overlay mode). |

Events

| Event | Detail | Description | | ------- | ------ | ---------------------------------------------------------------------------------------------------------- | | close | — | Fired when the backdrop is clicked in overlay mode. Set left-drawer-open/right-drawer-open to false. |

Slots

| Slot | Description | | --------- | --------------------- | | left | Left drawer content. | | (default) | Main content area. | | right | Right drawer content. |

CSS Parts

| Part | Description | | -------------- | ------------------ | | main | Main content slot. | | left-drawer | Left drawer slot. | | right-drawer | Right drawer slot. | | backdrop | Overlay backdrop. |

CSS Custom Properties

| Property | Default | Description | | ------------------------------------------- | -------------------- | ------------------------------------------------- | | --cosmoz-drawer-layout-left-drawer-width | min(400px, 100cqw) | Width of the left drawer. | | --cosmoz-drawer-layout-right-drawer-width | min(400px, 100cqw) | Width of the right drawer. | | --cosmoz-drawer-layout-backdrop-color | rgba(0, 0, 0, 0.3) | Backdrop color in overlay mode. | | --cosmoz-drawer-layout-gap | var(--cz-spacing) | Gap between drawer and main content in side mode. |

Side mode vs overlay mode

  • Side mode (viewport ≥ breakpoint): Drawers are positioned inline, always visible, with no backdrop.
  • Overlay mode (viewport < breakpoint): Drawers slide in as fixed overlays with a backdrop. Clicking the backdrop dispatches a close event.
  • breakpoint="0": Always side mode, regardless of viewport size.

cosmoz-side-panel

A companion panel element for use inside cosmoz-drawer-layout slots. By default it renders as a plain container with a white background. Add the bordered attribute for a card-like appearance with borders, border-radius, and margin.

In overlay mode (inside cosmoz-drawer-layout), borders and border-radius are automatically removed from bordered panels for a full-bleed drawer appearance.

Attributes

| Attribute | Type | Description | | ---------- | ------- | ----------------------------------------------------------------------------------------------------------------- | | bordered | boolean | Adds card-like borders, border-radius, and margin. In overlay mode, borders and radius are automatically removed. |

Slots

| Slot | Description | | --------- | -------------- | | (default) | Panel content. |

CSS Parts

| Part | Description | | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | panel | The panel wrapper. Warning: Setting border or border-radius via ::part(panel) will suppress automatic overlay-mode zeroing. Use the bordered attribute with --cosmoz-side-panel-* custom properties for borders that zero automatically. |

CSS Custom Properties

These properties only take effect when the bordered attribute is set.

| Property | Default | Description | | ----------------------------------- | ------------------- | ---------------------------------------- | | --cosmoz-side-panel-border-radius | 16px | Panel radius. | | --cosmoz-side-panel-border-right | 1px solid #ebebeb | Right border. | | --cosmoz-side-panel-border-left | 1px solid #ebebeb | Left border. | | --cosmoz-side-panel-border-top | 1px solid #ebebeb | Top border. | | --cosmoz-side-panel-border-bottom | 1px solid #ebebeb | Bottom border. | | --cosmoz-side-panel-margin | 5px | Panel padding (applied when bordered). |

Styling drawers

For non-border customization (background, overflow, etc.), use ::part(panel):

cosmoz-side-panel::part(panel) {
	background: var(--cz-color-bg-secondary, #f9fafb);
	overflow: hidden;
}

For side-specific divider borders, use ::part(panel) on the slotted panel. These borders won't auto-zero in overlay mode — which is typically fine since a single divider line looks acceptable in both modes:

cosmoz-side-panel[slot='left']::part(panel) {
	border-right: 1px solid var(--cz-color-border-secondary, #e9eaeb);
}

For card-like panels with borders that auto-zero in overlay mode, use the bordered attribute with CSS custom properties:

cosmoz-side-panel[bordered] {
	--cosmoz-side-panel-border-radius: 8px;
	--cosmoz-side-panel-margin: 0;
	--cosmoz-side-panel-border-top: 0;
	--cosmoz-side-panel-border-bottom: 0;
}

Development

npm install
npm run storybook:start   # Start Storybook on port 8000
npm run build             # Build to dist/
npm test                  # Run tests
npm run lint              # Type-check and lint

License

Apache-2.0