Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oguzhan18 avatar

Angular Elements

  • 186 installs
  • 6 repo stars
  • Updated April 4, 2026
  • oguzhan18/angular-ecosystem-skills

Packaging Angular components as custom elements to embed in non-Angular pages, CMS themes, legacy stacks, or micro-frontend shells without a full SPA bootstrap.

About

Explains how to convert Angular components into standards-based custom elements, bundle them for external pages, and handle styling, lifecycle, and deployment for embeddable widgets.

  • @angular/elements bootstrap workflow
  • Custom element packaging and lazy load
  • Change detection in embedded widgets
  • Style encapsulation across host pages
  • Versioning and bundle size tradeoffs

Angular Elements by the numbers

  • 186 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #881 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oguzhan18/angular-ecosystem-skills --skill angular-elements

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs186
repo stars6
Last updatedApril 4, 2026
Repositoryoguzhan18/angular-ecosystem-skills

What it does

Packaging Angular components as custom elements to embed in non-Angular pages, CMS themes, legacy stacks, or micro-frontend shells without a full SPA bootstrap.

Files

SKILL.mdMarkdownGitHub ↗

@angular/elements

Version: Angular 21 (2025) Tags: Web Components, Custom Elements, Micro-frontends

References: Elements GuideAPI

API Changes

This section documents recent version-specific API changes.

  • NEW: createCustomElement API — Package Angular components as custom elements
  • NEW: NgElementConfig — Configure custom element behavior
  • NEW: Input/Output mapping — Map Angular inputs/outputs to web component attributes
  • NEW: Standalone elements — Build standalone elements without NgModule

Best Practices

  • Install @angular/elements
npm install @angular/elements
  • Create custom element from component
import { createCustomElement } from '@angular/elements';

@Injectable()
export class ElementRegistrar {
  constructor(private injector: Injector) {}

  register() {
    const element = createCustomElement(MyComponent, { injector: this.injector });
    customElements.define('my-element', element);
  }
}
  • Use in main.ts
import { createApplication } from '@angular/platform-browser';
import { createCustomElement } from '@angular/elements';

bootstrapApplication(AppComponent).then(appRef => {
  const element = createCustomElement(MyComponent, { injector: appRef.injector });
  customElements.define('my-component', element);
});
  • Map inputs and outputs
const element = createCustomElement(MyComponent, {
  injector: this.injector,
  events: ['myEvent'],
  attributes: ['myInput']
});
  • Use CUSTOM_ELEMENTS_SCHEMA
// To use custom elements in Angular
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

@NgModule({
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
  • Build as web component
// angular.json
{
  "build": {
    "options": {
      "outputPath": "dist",
      "singleBundle": true
    }
  }
}
  • Use input() and output() for web component data
@Component({
  selector: 'my-element',
  standalone: true
})
export class MyElementComponent {
  data = input<string>('');
  output = output<string>();

  onClick() {
    this.output.emit('event-data');
  }
}
  • Handle content projection
@Component({
  selector: 'my-element',
  template: `
    <div class="header">
      <ng-content select="[header]"></ng-content>
    </div>
    <div class="body">
      <ng-content></ng-content>
    </div>
  `
})
export class MyElementComponent {}
  • Use for micro-frontends
// Register multiple elements
const elements = [ButtonComponent, CardComponent, InputComponent];
elements.forEach(comp => {
  const el = createCustomElement(comp, { injector });
  customElements.define(comp.selector, el);
});

Related skills

Frontend Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.