Communitygithub.com

coastdigitalgroup/coastai-skills – インタラクティブステートシステム

UI要素のユーザー操作(ホバー、フォーカス、アクティブ、無効など)における視覚的な振る舞いを設計・文書化し、ユーザビリティとアクセシビリティを確保します。

coastai-skills – インタラクティブステートシステム とは?

このスキルは、UIコンポーネントがユーザー入力にどのように応答するかを定義するための包括的なフレームワークを提供します。ボタン、リンク、入力フィールド、カードといったすべてのインタラクティブ要素に対して、マウス、キーボード、タッチのすべての操作モードで一貫性のあるアクセシブルな視覚フィードバックを定義できます。開発者にとってのあいまいさを排除し、エンドユーザーに高品質で応答性の高い体験を保証します。主な機能としては、状態マトリクスの生成、遷移ガイドライン(持続時間、イージング関数)、アクセシビリティ仕様(フォーカスリングのコントラスト要件など)の策定が含まれます。特に、ホバーに依存した情報配置の禁止や、タッチデバイス向けの最適化(アクティブ状態の即時フィードバック、タッチターゲットサイズの要件)など、モバイル対応も重視しています。このスキルは、Cursor、Claude Code、CodexなどのAIエージェントと組み合わせて、デザインシステムやUIライブラリの構築、既存サイトのインタラクション監査、WCAG 2.2準拠の確保に活用できます。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/interactive-state-system

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

インタラクティブステートシステム

目的

Interactive State System スキルは、UIコンポーネントがユーザー入力にどのように応答するかを定義するためのフレームワークを提供します。すべてのインタラクティブ要素(ボタン、リンク、入力フィールド、カード)が、すべての操作モード(マウス、キーボード、タッチ)において明確で一貫性のあるアクセシブルな視覚フィードバックを持つことを保証します。このシステムは開発者のあいまいさを排除し、エンドユーザーに高品質で応答性の高い感触を保証します。

使用例

  • デザインシステムやUIライブラリのコンポーネントの振る舞いを定義する。
  • 既存サイトで「動かない」または応答しないインタラクションを監査する。
  • フォーカスインジケーター、ターゲットサイズ、インタラクティブアフォーダンスに関するWCAG 2.2準拠を確保する。
  • フィードバックパターンを標準化する(例:すべての破壊的操作が同じように振る舞う)。

使用すべきでない場合

  • 静的コンテンツ: クリック、タップ、キーボード操作がまったくない純粋な情報要素。
  • 実験的なモーションデザイン: 機能的な状態フィードバックではなく、複雑で標準的でないアニメーションが目的の場合。
  • 標準ブラウザデフォルト: プロジェクトがスタイル未設定のネイティブブラウザ要素に厳密に依存する場合(ただし、プロフェッショナルなWebサイトデザインでは稀)。

入力

  1. コンポーネントインベントリ: デザイン内のすべてのインタラクティブ要素のリスト。
  2. ブランドカラーシステム: 既存のプライマリ、セカンダリ、セマンティックカラースケール。
  3. アクセシビリティ目標: (例:WCAGレベルAA)状態のコントラスト比を決定します。

出力

  1. 状態マトリクス: すべてのコンポーネントのデフォルト、ホバー、フォーカス、アクティブ、無効状態を示す包括的なマップ。
  2. インタラクションガイドライン: トランジション、持続時間(ms)、イージング関数のルール。
  3. アクセシビリティ仕様: フォーカスリングとキーボード専用の視覚的手がかりの明確な定義。

ワークフロー

1. インタラクティブ要素の特定

要素をインタラクションタイプごとに分類します:

  • アクション: ボタン、リンク、メニュー項目。
  • 入力: テキストフィールド、チェックボックス、ラジオボタン、セレクト。
  • コンテナ: クリッカブルカード、アコーディオンヘッダー、タブ。

2. 状態パレットの定義

状態ごとに視覚変数がどのように変化するかを決定します:

  • ホバー(マウス): 背景色、境界線、またはエレベーション(シャドウ)の微妙な変化。
  • フォーカス(キーボード): 高コントラストなリングまたはアウトライン。ホバー状態とは明確に区別できること。
  • アクティブ/押下: 視覚的な「圧縮」(例:わずかに暗くする、または縮小)により、クリック/タップが成功したことを示す。
  • 無効: 不透明度を下げ、インタラクティブな手がかりを削除する(カーソルの変更)。
  • 訪問済み(リンク): 移動済みリンクのための明確な色(コンテンツが多いサイトでは重要)。

3. フォーカスロジックの確立

キーボードユーザーが常に現在位置を把握できる「グローバルフォーカススタイル」を設計します。

  • ルール: フォーカスインジケーターは、背景およびコンポーネントの非フォーカス状態に対して、少なくとも3:1のコントラスト比を持つ必要があります。
  • ルール(WCAG 2.2 SC 2.4.11): フォーカスインジケーターは、他のコンテンツによって完全に隠れてはなりません(例:スクロール時にスティッキーヘッダーがフォーカス要素を覆う)。インジケーターの少なくとも一部は常に表示されたままである必要があります。

4. タッチ(モバイル)向けの最適化

タッチデバイスにはホバー状態がないため:

  • active 状態が即座にフィードバックを提供することを確認します。
  • タッチターゲットがWCAG 2.2 SC 2.5.8(最低24x24px)を満たしていることを確認し、レイアウトが許せば快適な親指操作のために44x44pxを推奨します。
  • ホバーに依存した情報は削除します(タップ時や永続ラベルでツールチップを使用)。

5. トランジションの文書化

変化の発生方法を定義します:

  • 持続時間: 150ms〜250msが状態変化の標準。
  • イージング: ease-in-out または cubic-bezier(0.4, 0, 0.2, 1)。

決定ルール

  • 状態の持続性: フォーカスインジケーターは、要素がフォーカスを持っている限り表示され続ける必要があります。
  • アフォーダンス優先: インタラクティブ要素は、デフォルト状態で「クリック可能」に見える必要があります(例:ボタンはクリック不可のタグよりも視覚的な重みを持つべき)。
  • 色のみの状態禁止: 状態を示すために色だけに依存してはいけません(例:エラー状態にはアイコンや境界線の太さの変更を含めるべき)。
  • 即時フィードバック: インタラクティブな応答は瞬時に感じられる必要があります(<100msの開始時間)。

制約事項

  • アクセシビリティ: フォーカスインジケーターは、堅牢な代替手段を提供せずにCSSの outline: none で「隠す」ことはできません。
  • レスポンシブ対応: 状態は、マウスホバーに依存せずに小さな画面でも機能する必要があります。
  • パフォーマンス: 頻繁にトリガーされる状態(ホバーなど)で、レイアウトスラッシングを防ぐために、重いボックスシャドウや複雑なフィルターを避けます。

よくある失敗パターン

  • 「見えない」フォーカス: ブラウザのデフォルトフォーカスリングを削除し、それを置き換えないこと。これにより、キーボードユーザーにとってサイトが使用不能になります。
  • ホバーのみのロジック: 重要な情報やアクションをホバー状態にのみ配置し、モバイルでアクセス不能にする。
  • あいまいなアクティブ状態: クリック時に変化しないボタン。ユーザーが複数回クリックしてしまう原因になります。
  • 紛らわしい無効状態: 無効に見えるが実際はクリック可能な要素、またはその逆。

検証基準

  • すべてのインタラクティブ要素に、ホバー、フォーカス、アクティブ状態が定義されている。
  • フォーカスインジケーターが3:1のコントラスト要件を満たし、他のコンテンツによって完全に隠されることがない(WCAG 2.2 SC 2.4.11)。
  • タッチターゲットが少なくとも24x24px(WCAG 2.2 SC 2.5.8)、44x44pxを推奨。
  • 重要な情報がホバーのみのインタラクションに隠されていない。
  • 無効状態が視覚的に明確で、pointer-events: none(または同等のロジック)が適用されている。
  • システムに状態の明確なトランジション/アニメーションガイドラインが含まれている。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for progressive disclosure using accordions, ensuring structural integrity, visual affordances, and accessibility across different content densities and devices.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for long-form content, managing readability, vertical rhythm, and information density to ensure a superior reading experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for informational elements that communicate state (Badges) and categorization (Tags) with clarity and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for non-overlay notifications, managing global announcements and contextual inline alerts to communicate system states without interrupting the user's flow.

coastdigitalgroup/coastai-skills

Design and implement a systematic, asymmetrical bento-grid layout framework to organize diverse content types cohesively while maintaining strict visual hierarchy, logical focus order, and responsive flexibility.

coastdigitalgroup/coastai-skills

Design a responsive, mobile-first bottom navigation bar and persistent action dock system for mobile websites and web applications, establishing spatial anchors, tab bar anatomy, badge indicators, thumb-zone ergonomics, safe area inset handling, active/inactive state contrast, and desktop responsive adaptation rules.

coastdigitalgroup/coastai-skills

Design a mobile-first bottom sheet overlay system with configurable detents, drag affordances, safe area padding, responsive desktop modal/popover adaptation, and WCAG AA accessibility compliance.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for secondary navigation trails that provide orientation, context, and one-click access to parent levels in deep information architectures.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for buttons and interactive triggers, managing visual hierarchy, variant logic, and action grouping to ensure clear intent and accessible interaction.

coastdigitalgroup/coastai-skills

Design a systematic framework for date and time selection, managing calendar grids, range pickers, and scheduling interfaces to ensure precision and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for modular content containers that maintain hierarchy, structural integrity, and action alignment across variable content and responsive viewports.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for horizontal discovery components, managing navigation affordances, scroll behavior, and accessibility to ensure effective content density without compromising usability.

coastdigitalgroup/coastai-skills

Design a systematic, highly accessible, and developer-friendly UI layout framework for code blocks, snippet showcases, multi-file code tabs, line-highlighting, diff views, and syntax token contrast in technical documentation and developer platforms.

coastdigitalgroup/coastai-skills

Design a systematic framework for global command menus (Cmd+K panels) that combines keyboard-driven navigation, command execution, and shortcut discovery into an accessible, responsive overlay.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for threaded conversations, managing nesting depths, action hierarchies, and community signaling to foster engagement and readability.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for side-by-side comparison interfaces, managing high attribute density and responsive complexity to support informed decision-making.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for user privacy, managing consent banners, preference centers, and persistent privacy controls to balance legal compliance with user trust.

coastdigitalgroup/coastai-skills

Design and implement a systematic, highly accessible, and responsive visual layout framework for conversational chat widgets, live chat boxes, and chatbot panels that ensures clear message scannability, native focus flow, and seamless mobile keyboard adaptation.

coastdigitalgroup/coastai-skills

Design a systematic, accessible, and high-conversion framework for custom select dropdowns and comboboxes, defining anatomy, states, search-filtering, and responsive mobile-adaptive patterns.

coastdigitalgroup/coastai-skills

Design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

関連スキル