angular-directives

Installation
Summary

Custom directives for DOM manipulation, behavior extension, and component composition in Angular v20+.

  • Attribute directives modify element appearance and behavior using the host property for event handling, class binding, and ARIA attributes; includes patterns for tooltips, highlights, buttons, click-outside detection, and keyboard shortcuts
  • Structural directives handle portal rendering, lazy initialization, and template context injection for DOM manipulation beyond native @if, @for, @switch control flow
  • Host directives compose reusable behaviors across components and other directives, exposing inputs and outputs for flexible behavior composition
  • Built on Angular v20+ signals, inputs, outputs, and effects for reactive, type-safe directive development
SKILL.md

Angular Directives

Create custom directives for reusable DOM manipulation and behavior in Angular v20+.

Attribute Directives

Modify the appearance or behavior of an element:

import { Directive, input, effect, inject, ElementRef } from '@angular/core';

@Directive({
  selector: '[appHighlight]',
})
export class Highlight {
  private el = inject(ElementRef<HTMLElement>);
  
  // Input with alias matching selector
  color = input('yellow', { alias: 'appHighlight' });
Related skills

More from analogjs/angular-skills

Installs
4.2K
GitHub Stars
588
First Seen
Jan 24, 2026