jpskill.com
🛠️ 開発・MCP コミュニティ

angular-material-v20

Angular 20以降のアプリケーションで、最新のMaterial Design UIコンポーネントを効率的に実装し、テーマ設定やアクセシビリティ対応を支援するSkill。

📜 元の英語説明(参考)

Angular Material v20 UI component library for Angular 20+ applications. Use when implementing Material Design components, theming, forms, tables, dialogs, navigation, or building Material-based UI. Covers component APIs, accessibility, and best practices for Material 20.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Angular 20以降のアプリケーションで、最新のMaterial Design UIコンポーネントを効率的に実装し、テーマ設定やアクセシビリティ対応を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Angular Material v20 スキル

ルール

インストール

  • 自動セットアップには ng add @angular/material を使用してください。
  • @angular/material@~20.0.0@angular/cdk@~20.0.0 を一緒にインストールする必要があります。

コンポーネントのインポート

  • 特定のコンポーネントモジュール(例:MatDialogModuleMatFormFieldModule)をインポートしてください。
  • 明示的な imports 配列を持つスタンドアロンコンポーネントを使用してください。
  • Material ライブラリ全体をインポートしてはいけません

テーマ設定

  • @use '@angular/material' as mat; 構文を使用してください。
  • テーマ定義の前に mat.core() を含めてください。
  • mat.define-light-theme() または mat.define-dark-theme() でテーマを定義してください。
  • テーマを適用するために mat.all-component-themes($theme) を含めてください。

フォームフィールド

  • matInput 要素を <mat-form-field> で囲んでください。
  • appearance 属性(outlinefill、または standard)を使用してください。
  • アクセシビリティのために <mat-label> を含めてください。
  • フィールドが無効でタッチされたときに <mat-error> でエラーを表示してください。

ダイアログの使用

  • MatDialog サービスをインジェクトしてください。
  • ダイアログを開くには dialog.open(Component, config) を使用してください。
  • widthdata、およびその他のオプションでダイアログを設定してください。
  • MAT_DIALOG_DATA インジェクショントークンを介してダイアログデータにアクセスしてください。

アクセシビリティ

  • すべてのコンポーネントで ARIA ガイドラインに従ってください。
  • テキストコンテンツが表示されない場合は aria-labels を含めてください。
  • すべてのインタラクティブ要素でキーボードナビゲーションが機能することを確認してください。

変更検知

  • OnPush 変更検知戦略を使用してください。
  • リアクティブな状態管理にはシグナルを活用してください。

パフォーマンス

  • 可能な場合は Material モジュールを遅延ロードしてください。
  • 必要なコンポーネントモジュールのみをインポートしてください。
  • 大規模なリストには cdk-virtual-scroll-viewport を使用して仮想スクロールを使用してください。

コンテキスト

概要

Angular Material v20 は、Angular 20+ アプリケーション向けの公式 Material Design コンポーネントライブラリであり、テーマサポートとアクセシビリティ機能を備えた事前構築済みの UI コンポーネントを提供します。

このスキルを使用するタイミング

以下の必要がある場合にこのスキルをアクティブにしてください。

  • Angular アプリケーションで Material Design コンポーネントを実装する
  • Material のテーマ設定を行う、またはカスタマイズする
  • フォームコントロール(入力、選択、チェックボックス、日付ピッカー)を操作する
  • ナビゲーションコンポーネント(ツールバー、サイドナビ、メニュー、タブ)を作成する
  • カード、展開パネル、ステッパーでレイアウトを構築する
  • ソートとページネーションを備えたテーブルにデータを表示する
  • ダイアログ、スナックバー、ツールチップ、またはボトムシートを表示する
  • WCAG アクセシビリティ準拠を確保する
  • Material コンポーネントのパフォーマンスを最適化する

コアコンポーネント

フォームコントロール

  • MatInput - テキスト入力フィールド
  • MatSelect - ドロップダウン選択
  • MatCheckbox - チェックボックス入力
  • MatRadioButton - ラジオボタンのグループ
  • MatSlideToggle - トグルスイッチ
  • MatSlider - スライダー入力
  • MatDatepicker - 日付選択

ナビゲーション

  • MatToolbar - トップナビゲーションバー
  • MatSidenav - サイドナビゲーションドロワー
  • MatMenu - ドロップダウンメニュー
  • MatTabs - タブ付きナビゲーション

レイアウト

  • MatCard - カードコンテナ
  • MatDivider - 視覚的な区切り線
  • MatExpansionPanel - 折りたたみ可能なパネル
  • MatGridList - グリッドレイアウト
  • MatList - リスト表示
  • MatStepper - ステップバイステップのワークフロー

ボタンとインジケーター

  • MatButton - ボタンのバリアント
  • MatButtonToggle - トグルボタンのグループ
  • MatBadge - 通知バッジ
  • MatChip - チップ要素
  • MatIcon - アイコン表示
  • MatProgressBar - 線形プログレス
  • MatProgressSpinner - 円形プログレス

ポップアップとモーダル

  • MatDialog - モーダルダイアログ
  • MatSnackBar - トースト通知
  • MatTooltip - ホバーツールチップ
  • MatBottomSheet - ボトムシートモーダル

データテーブル

  • MatTable - データテーブル表示
  • MatSort - 列のソート
  • MatPaginator - テーブルのページネーション

テーマ設定の例

// styles.scss
@use '@angular/material' as mat;

@include mat.core();

$my-primary: mat.define-palette(mat.$indigo-palette);
$my-accent: mat.define-palette(mat.$pink-palette);
$my-warn: mat.define-palette(mat.$red-palette);

$my-theme: mat.define-light-theme((
  color: (
    primary: $my-primary,
    accent: $my-accent,
    warn: $my-warn,
  )
));

@include mat.all-component-themes($my-theme);

ダイアログの例

import { Component, inject } from '@angular/core';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [MatDialogModule],
  template: `
    <button mat-raised-button (click)="openDialog()">
      Open Dialog
    </button>
  `
})
export class ExampleComponent {
  dialog = inject(MatDialog);

  openDialog() {
    this.dialog.open(MyDialogComponent, {
      width: '400px',
      data: { name: 'Example' }
    });
  }
}

フォームフィールドの例

import { Component } from '@angular/core';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { ReactiveFormsModule } from '@angular/forms';

@Component({
  selector: 'app-form',
  standalone: true,
  imports: [MatFormFieldModule, MatInputModule, ReactiveFormsModule],
  template: `
    <mat-form-field appearance="outline">
      <mat-label>Email</mat-label>
      <input matInput [formControl]="email" />
      <mat-error *ngIf="email.hasError('required')">
        Email is required
      </mat-error>
    </mat-form-field>
  `
})
export class FormComponent {
  email = new FormControl('', Validators.required);
}

ベストプラクティス

  1. モジュールのインポート - ツリーシェイキングを改善するために特定のコンポーネントモジュールをインポートしてください。
  2. テーマの使用 - 一貫したスタイリングのために Material のテーマシステムを活用してください。
  3. アクセシビリティ - ARIA ガイドラインに従い、キーボードナビゲーションを確保してください。
  4. OnPush - パフォーマンス向上のためにシグナルと OnPush 変更検知を使用してください。
  5. 遅延ロード - 初期バンドルサイズを削減するために、可能な場合は Material モジュールを遅延ロードしてください。

参考文献

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Angular Material v20 Skill

Rules

Installation

  • Use ng add @angular/material for automatic setup
  • Must install @angular/material@~20.0.0 and @angular/cdk@~20.0.0 together

Component Imports

  • Import specific component modules (e.g., MatDialogModule, MatFormFieldModule)
  • Use standalone components with explicit imports array
  • NEVER import entire Material library

Theming

  • Use @use '@angular/material' as mat; syntax
  • Include mat.core() before theme definitions
  • Define theme with mat.define-light-theme() or mat.define-dark-theme()
  • Include mat.all-component-themes($theme) to apply theme

Form Fields

  • Wrap matInput elements in <mat-form-field>
  • Use appearance attribute: outline, fill, or standard
  • Include <mat-label> for accessibility
  • Show errors with <mat-error> when field is invalid and touched

Dialog Usage

  • Inject MatDialog service
  • Use dialog.open(Component, config) to open dialogs
  • Configure dialog with width, data, and other options
  • Access dialog data via MAT_DIALOG_DATA injection token

Accessibility

  • Follow ARIA guidelines for all components
  • Include aria-labels where text content is not visible
  • Ensure keyboard navigation works for all interactive elements

Change Detection

  • Use OnPush change detection strategy
  • Leverage signals for reactive state management

Performance

  • Lazy load Material modules when possible
  • Import only required component modules
  • Use virtual scrolling for large lists with cdk-virtual-scroll-viewport

Context

Summary

Angular Material v20 is the official Material Design component library for Angular 20+ applications, providing pre-built UI components with theming support and accessibility features.

When to Use This Skill

Activate this skill when you need to:

  • Implement Material Design components in Angular applications
  • Set up or customize Material theming
  • Work with form controls (inputs, selects, checkboxes, datepickers)
  • Create navigation components (toolbar, sidenav, menu, tabs)
  • Build layouts with cards, expansion panels, steppers
  • Display data in tables with sorting and pagination
  • Show dialogs, snackbars, tooltips, or bottom sheets
  • Ensure WCAG accessibility compliance
  • Optimize Material component performance

Core Components

Form Controls

  • MatInput - Text input fields
  • MatSelect - Dropdown selection
  • MatCheckbox - Checkbox inputs
  • MatRadioButton - Radio button groups
  • MatSlideToggle - Toggle switches
  • MatSlider - Slider inputs
  • MatDatepicker - Date selection

Navigation

  • MatToolbar - Top navigation bar
  • MatSidenav - Side navigation drawer
  • MatMenu - Dropdown menus
  • MatTabs - Tabbed navigation

Layout

  • MatCard - Card containers
  • MatDivider - Visual separators
  • MatExpansionPanel - Collapsible panels
  • MatGridList - Grid layouts
  • MatList - List displays
  • MatStepper - Step-by-step workflows

Buttons & Indicators

  • MatButton - Button variants
  • MatButtonToggle - Toggle button groups
  • MatBadge - Notification badges
  • MatChip - Chip elements
  • MatIcon - Icon display
  • MatProgressBar - Linear progress
  • MatProgressSpinner - Circular progress

Popups & Modals

  • MatDialog - Modal dialogs
  • MatSnackBar - Toast notifications
  • MatTooltip - Hover tooltips
  • MatBottomSheet - Bottom sheet modals

Data Tables

  • MatTable - Data table display
  • MatSort - Column sorting
  • MatPaginator - Table pagination

Theming Example

// styles.scss
@use '@angular/material' as mat;

@include mat.core();

$my-primary: mat.define-palette(mat.$indigo-palette);
$my-accent: mat.define-palette(mat.$pink-palette);
$my-warn: mat.define-palette(mat.$red-palette);

$my-theme: mat.define-light-theme((
  color: (
    primary: $my-primary,
    accent: $my-accent,
    warn: $my-warn,
  )
));

@include mat.all-component-themes($my-theme);

Dialog Example

import { Component, inject } from '@angular/core';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [MatDialogModule],
  template: `
    <button mat-raised-button (click)="openDialog()">
      Open Dialog
    </button>
  `
})
export class ExampleComponent {
  dialog = inject(MatDialog);

  openDialog() {
    this.dialog.open(MyDialogComponent, {
      width: '400px',
      data: { name: 'Example' }
    });
  }
}

Form Field Example

import { Component } from '@angular/core';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { ReactiveFormsModule } from '@angular/forms';

@Component({
  selector: 'app-form',
  standalone: true,
  imports: [MatFormFieldModule, MatInputModule, ReactiveFormsModule],
  template: `
    <mat-form-field appearance="outline">
      <mat-label>Email</mat-label>
      <input matInput [formControl]="email" />
      <mat-error *ngIf="email.hasError('required')">
        Email is required
      </mat-error>
    </mat-form-field>
  `
})
export class FormComponent {
  email = new FormControl('', Validators.required);
}

Best Practices

  1. Import modules - Import specific component modules for better tree-shaking
  2. Use theming - Leverage Material's theming system for consistent styling
  3. Accessibility - Follow ARIA guidelines and ensure keyboard navigation
  4. OnPush - Use OnPush change detection with signals for better performance
  5. Lazy loading - Lazy load Material modules where possible to reduce initial bundle size

References