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

@nextrap/nte-demo-viewer

v1.0.1

Published

A component for viewing and switching between multiple demo files with live code editing support. Ideal for component documentation and interactive demos.

Downloads

38

Readme

nte-demo-viewer

A component for viewing and switching between multiple demo files with live code editing support. Ideal for component documentation and interactive demos.

Features

  • Demo Switching - FAB button with menu to switch between multiple demos
  • Code Viewer - View the Markdown source of the current demo
  • Live Editing - Edit Markdown code with live preview (500ms debounce)
  • Responsive - Split view on desktop, stacked on mobile
  • Theming - Fully customizable via CSS Custom Properties

Installation

import '@nextrap/nte-demo-viewer';

Basic Usage

<nte-demo-viewer>
  <demo title="Basic Demo" src="/demo/basic.md"></demo>
  <demo title="Advanced Demo" src="/demo/advanced.md"></demo>
</nte-demo-viewer>

Demo Element Attributes

| Attribute | Type | Description | Required | | ------------- | ------ | ------------------------------------ | -------- | | title | string | Display title in the menu | Yes | | src | string | Path to the Markdown demo file | Yes | | description | string | Optional description shown in menu | No |

Example with Descriptions

<nte-demo-viewer>
  <demo 
    title="Allgemeine Demo" 
    description="Grundlegende Accordion-Funktionalität" 
    src="/demo/base.md">
  </demo>
  <demo 
    title="Exclusive Accordion" 
    description="Nur ein Element kann geöffnet werden" 
    src="/demo/base2.md">
  </demo>
</nte-demo-viewer>

Events

| Event | Detail | Description | | ------------- | ----------------------------------- | ---------------------------------- | | demo-change | { index: number, demo: DemoConfig } | Fired when selected demo changes | | code-change | { content: string } | Fired when code is edited |

CSS Custom Properties

All styling can be customized via CSS Custom Properties on nte-demo-viewer:

FAB (Floating Action Button)

| Property | Default | Description | | --------------------- | ----------------------- | ------------------------ | | --nte-fab-size | 56px | Size of the FAB | | --nte-fab-bg | var(--nt-primary) | Background color | | --nte-fab-bg-hover | var(--nt-primary-emphasis) | Hover background | | --nte-fab-color | var(--text-on-primary)| Text/icon color | | --nte-fab-shadow | 0 4px 12px rgba(...) | Box shadow | | --nte-fab-z-index | 10000 | Z-index |

Menu

| Property | Default | Description | | ----------------------------- | ---------------------------- | ------------------------ | | --nte-menu-width | 300px | Menu width | | --nte-menu-bg | var(--nt-light) | Background color | | --nte-menu-border | var(--nt-light-emphasis) | Border color | | --nte-menu-border-radius | 12px | Border radius | | --nte-menu-item-color | var(--nt-secondary-emphasis) | Item text color | | --nte-menu-item-hover-bg | var(--nt-primary-subtle) | Item hover background | | --nte-menu-item-active-bg | var(--nt-primary) | Active item background | | --nte-menu-item-active-color| var(--nt-text-on-primary) | Active item text color |

Badge

| Property | Default | Description | | ------------------ | ------------------------ | ------------------------ | | --nte-badge-bg | var(--nt-warning) | Badge background | | --nte-badge-color| var(--nt-text-on-warning) | Badge text color |

Code Editor

| Property | Default | Description | | --------------------- | ---------------------------- | ------------------------ | | --nte-code-bg | var(--nt-dark) | Editor background | | --nte-code-color | var(--nt-text-on-dark) | Editor text color | | --nte-code-header-bg| var(--nt-dark-emphasis) | Header background | | --nte-code-border | var(--nt-dark-emphasis) | Border color | | --nte-code-font | Consolas, Monaco, monospace| Editor font family |

Requirements

This component requires:

  • @trunkjs/content-pane - For rendering Markdown content
  • @trunkjs/markdown-loader - For loading Markdown files
  • @nextrap/style-base - For base styling variables
import '@nextrap/style-base';
import '@trunkjs/content-pane';
import '@trunkjs/markdown-loader';
import '@nextrap/nte-demo-viewer';

Notes

  • The component uses Light DOM rendering (not Shadow DOM) to allow tj-markdown-loader to find tj-content-pane
  • Demo files should be valid Markdown with Kramdown-style layout annotations
  • The code editor provides live preview with a 500ms debounce to avoid excessive re-renders