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

@sunku/email-builder

v0.2.4

Published

Drag-and-drop email template editor for Angular, packaged as a standalone component. Builds responsive, email-client-safe HTML.

Downloads

649

Readme

@sunku/email-builder

Drag-and-drop email template editor for Angular, packaged as a standalone component. Builds responsive, email-client-safe HTML.

Installation

npm install @sunku/email-builder --save

Peer dependencies: @angular/core, @angular/common, @angular/cdk, @angular/forms, @angular/platform-browser, rxjs.

The editor uses HttpClient, so your app needs provideHttpClient().

Usage

Import the standalone component and drop it in. No global stylesheet to wire up, no setup call — the component registers its blocks and injects its own styles.

import { Component, ViewChild } from '@angular/core';
import { EmailBuilderComponent, Template } from '@sunku/email-builder';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [EmailBuilderComponent],
  template: `
    <button (click)="exportHtml()">Export</button>

    <sunku-email-builder
      [design]="design"
      minHeight="100vh"
      (ready)="onReady()"
      (designChange)="onDesignChange($event)">
    </sunku-email-builder>
  `,
})
export class AppComponent {
  design: Template | null = null;

  @ViewChild(EmailBuilderComponent)
  private editor!: EmailBuilderComponent;

  onReady() {
    // The editor is initialised. Load a saved design at any point:
    // this.editor.loadDesign(savedJsonOrTemplate);
  }

  onDesignChange(design: Template) {
    // Fires on every edit — debounce before persisting.
  }

  exportHtml() {
    const { html, design } = this.editor.exportHtml();
    console.log(html, design);
  }
}

Using an NgModule instead of standalone components? Add EmailBuilderComponent to that module's imports — standalone components are importable from modules.

Inputs

| Input | Type | Default | Description | | --- | --- | --- | --- | | design | Template \| string \| null | null | Design to load, as an object or JSON string. Reassigning reloads the editor. Unset starts blank. | | minHeight | string | '600px' | Smallest height the editor may occupy. Grows if the parent is taller; pass 100vh for a full-page editor. |

Outputs

| Output | Payload | Description | | --- | --- | --- | | ready | — | Editor initialised and first design loaded. | | designChange | Template | Fires on every edit. Debounce it for autosave. |

Methods

Access them through @ViewChild(EmailBuilderComponent).

| Method | Params | Description | | --- | --- | --- | | loadDesign | Template \| string | Replaces the current design. | | saveDesign | callback? | Returns the design; also passes it to the callback. | | saveDesignJson | — | Returns the design serialised to JSON. | | exportHtml | callback? | Returns { html, design }; also passes it to the callback. | | newDesign | name? | Starts a blank template. |

Image search (optional)

The sidebar's image search needs a free Pixabay API key. No key ships with the package — without one, that tab shows setup instructions instead of search results.

import { PIXABAY_API_KEY } from '@sunku/email-builder';

providers: [{ provide: PIXABAY_API_KEY, useValue: 'your-key' }]

Going lower-level

EmailBuilderComponent is a thin facade. For full control, use EditorShellComponent (the bare UI) and drive it through the exported services, all providedIn: 'root':

  • EditorEngineServicenewTemplate(), loadTemplate(), loadFromJson(), block/row operations, undo/redo, logo versions.
  • EditorStore.template() — the current template as a signal.
  • RenderEngineService.render(template) — the final email HTML.
  • TemplateEngineService.serialize() / .deserialize() — JSON import/export.

Development

Build the library from this repo:

ng build email-builder

Output goes to dist/email-builder. For a local link during development, point the consuming project at it:

"@sunku/email-builder": "file:../snap-email-builder/dist/email-builder"

Re-run the build after changes for the link to pick them up.

Running unit tests

ng test email-builder

License

MIT