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

@ng-prism/core

v21.6.1

Published

Lightweight Angular-native component showcase — no story files needed.

Readme

ng-prism

Lightweight, Angular-native component showcase tool. Annotate components with @Showcase — no separate story files needed.

Angular TypeScript License

Features

  • Zero-config discovery — TypeScript Compiler API scans your library at build time
  • Signal-native — works with input() / output() signals
  • Directive support — showcase directives with configurable host elements
  • Plugin architecture — JSDoc, A11y, Figma, Performance, Box Model, Coverage plugins
  • Live Controls — auto-generated input controls with type-aware editors
  • Code Snippets — live-updating Angular template snippets per variant
  • Component Pages — free-form demo pages for complex components
  • Deep-linking — URL state sync for sharing specific component/variant/view
  • Themeable — full CSS custom property system, replaceable UI sections

Quick Start

1. Install

npm install @ng-prism/core

2. Add @Showcase to a component

import { Component, input, output } from '@angular/core';
import { Showcase } from '@ng-prism/core';

@Showcase({
  title: 'Button',
  category: 'Atoms',
  description: 'Primary action button',
  variants: [
    { name: 'Primary', inputs: { variant: 'primary', label: 'Click me' } },
    { name: 'Danger', inputs: { variant: 'danger', disabled: true } },
  ],
})
@Component({
  selector: 'my-button',
  standalone: true,
  template: `<button [class]="variant()">{{ label() }}</button>`,
})
export class ButtonComponent {
  variant = input<'primary' | 'secondary' | 'danger'>('primary');
  label = input('Button');
  disabled = input(false);
  clicked = output<void>();
}

3. Run the schematic

ng add @ng-prism/core

This creates the prism app project, configures Angular builders, and generates ng-prism.config.ts.

4. Start the dev server

ng run my-lib:prism

Open http://localhost:4400 — your component appears in the sidebar with live controls, code snippets, and variant tabs.

Configuration

// ng-prism.config.ts
import { defineConfig } from '@ng-prism/core/config';
import { jsDocPlugin } from '@ng-prism/plugin-jsdoc';

export default defineConfig({
  plugins: [jsDocPlugin()],

  theme: {
    '--prism-primary': '#00a67e',
    '--prism-bg': '#ffffff',
    '--prism-font-sans': "'Inter', sans-serif",
  },

  ui: {
    header: MyCustomHeaderComponent,
  },

  appProviders: [
    provideAnimationsAsync(),
    provideHttpClient(),
  ],
});

Directives

Directives need a host element. Use host to wrap them:

@Showcase({
  title: 'Tooltip',
  host: {
    selector: 'my-button',
    import: { name: 'ButtonComponent', from: 'my-lib' },
    inputs: { label: 'Hover me' },
  },
  variants: [
    { name: 'Top', inputs: { position: 'top', text: 'Tooltip!' } },
  ],
})
@Directive({ selector: '[myTooltip]' })
export class TooltipDirective { ... }

Component Pages

For complex components that need template projections or mock data:

// Register in main.ts
providePrism(PRISM_RUNTIME_MANIFEST, config, {
  componentPages: [
    { title: 'Table Demo', category: 'Data', component: TableDemoPage },
  ],
});

Link to a @Showcase-decorated component for combined API docs + custom rendering:

@Showcase({
  title: 'Table',
  renderPage: 'Table Demo',  // delegates rendering to the page
  variants: [{ name: 'Default', inputs: { height: '400px' } }],
})
@Component({ selector: 'my-table' })
export class TableComponent { ... }

Official Plugins

| Plugin | Package | Description | |---|---|---| | JSDoc | @ng-prism/plugin-jsdoc | API documentation from JSDoc comments | | Figma | @ng-prism/plugin-figma | Figma design embed + visual diff | | Box Model | @ng-prism/plugin-box-model | CSS box model inspector | | Perf | @ng-prism/plugin-perf | Render performance profiling | | Coverage | @ng-prism/plugin-coverage | Per-component test coverage from Istanbul/v8 |

Note: Accessibility auditing (axe-core) is built into ng-prism core — no plugin needed.

Documentation

Full documentation with API reference, plugin guide, and advanced configuration:

ng-prism Documentation

Requirements

  • Angular >= 19
  • TypeScript >= 5.9
  • Components must use input() / output() signals (not @Input() / @Output() decorators)

License

MIT