Communitygithub.com

バッジ・タグシステム

状態を伝えるバッジとカテゴリを示すタグを、明確かつアクセシブルに設計・実装するための体系的なフレームワークです。

バッジ・タグシステム とは?

このスキルは、Webサイト上でコンテンツの状態(ステータス)や分類(カテゴリ)を瞬時に伝える小さな情報コンポーネントであるバッジとタグを体系的に設計・実装するための方法論を提供します。バッジは主に「Active」「完了」などの非インタラクティブなステータスやカウント表示に使用され、タグは「SaaS」「チュートリアル」などのカテゴリ付けを行い、多くの場合インタラクティブでフィルタリングや削除が可能です。このスキルは、ボタンとの視覚的な差別化、意味に基づいたセマンティックカラーの一貫した適用、カラーユニバーサルデザインへの配慮(色+テキスト・アイコンの併用)、WCAG AA基準(コントラスト比4.5:1以上)を満たすアクセシビリティ、さらにレスポンシブ対応やタッチターゲットサイズ(最小24x24px、推奨44x44px)までを網羅した実践的なガイドラインを提供します。特に「Squint Test(細目テスト)」と呼ばれる、最も目立つ要素がプライマリコンテンツであることを確認する品質チェック手法や、1カードあたりのタグ数制限(最大3つ)などの具体的な判断ルールを備えている点が特徴です。Claude Code、Cursor、CodexなどのAIエージェントがUIデザインシステムの一部として活用できます。

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

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

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

ドキュメント

バッジ・タグシステム は何をしますか?

目的

バッジ・タグシステムは、コンテキスト、ステータス、カテゴリを素早く伝える小さな情報コンポーネントを設計・実装するための方法論を提供します。このスキルにより、これらの要素がプライマリコンテンツに対して二次的な役割を保ちつつ、一目で認識でき、アクセシブルで、Webサイト全体で論理的に整理されることを保証します。

ユースケース

  • ステータス表示: オブジェクトの状態(例:「アクティブ」「保留中」「売り切れ」)の表示。
  • カテゴリ分類: トピック、タイプ、コレクションによるコンテンツのラベリング(例:「仕事効率化」「チュートリアル」「新着」)。
  • 数量/カウント: アイテムに関連する数値の表示(例:「12件の通知」「カートに5個のアイテム」)。
  • フィルター表示: 現在アクティブなフィルターを表示し、ユーザーが削除できるようにする。
  • 優先度シグナリング: 「ベストセラー」「緊急」などの特定の属性を強調表示。

使用すべきでないケース

  • プライマリアクション: バッジやタグをメインのコールトゥアクション(CTA)として使用しないでください。interactive-state-systemのボタンを使用してください。
  • 大きなコンテンツブロック: 2〜3語以上の情報が必要な場合は、card-ui-systemまたは標準のタイポグラフィを使用してください。
  • ナビゲーション: タグはフィルタリングビューにリンクすることはできますが、プライマリのsite-navigation-systemを置き換えるものではありません。
  • 装飾専用アイコン: 要素に意味がない場合は、iconography-systemに属します。

入力

  1. コンテンツの意図: ステータス(状態)、カテゴリ(メタデータ)、またはカウント(数値)のいずれか?
  2. インタラクティブ要件: 要素は静的か、それとも削除可能/クリック可能か?
  3. 階層コンテキスト: 親要素は何か?(例:カード、ヘッダー、テーブル行)。
  4. カラートークン: 既存のセマンティックカラースケール(成功、警告、エラー、情報)。

出力

  1. ビジュアルアナトミー仕様: ボーダー半径(ピル vs. 角丸)、パディング、タイポグラフィの定義。
  2. セマンティックカラーマトリックス: 特定の意味への色のマッピング(例:緑 = 成功)。
  3. インタラクティブ仕様: ホバー、フォーカス、「削除」(X)アクションのビジュアル表現。
  4. 配置ルール: タイトルや画像に対するこれらの要素の相対的な位置のガイドライン。

ワークフロー

1. バッジとタグの区別

まず機能的な役割を定義します。

  • バッジ: 一般的にステータス(例:「ライブ」)やカウント(例:「3」)を示します。通常は非インタラクティブであるか、単一の状態にリンクします。
  • タグ: 一般的にカテゴリ分類(例:「SaaS」)を示します。多くの場合インタラクティブで、ユーザーがコンテンツをフィルタリングしたり、タグを削除したりできます。

2. ビジュアルアナトミーの確立

ボタンのように見えないベーススタイルを定義します。

  • タイポグラフィ: 小さめで、多くの場合はオールキャップスまたはセミボールドフォントを使用します(例:12px/0.75rem)。
  • ボーダー半径:
    • ピル(完全な丸み): ステータスやカウントに最適です。
    • 角丸(4〜8px): カテゴリ分類や削除可能なタグに最適です。
  • サイズ: 高さを一定に保ちます(例:20px〜24px)。これにより、テキストと適切に揃うようになります。

3. セマンティックロジックの割り当て(色とアイコン)

ユーザーが読まなくても意味が伝わるように色を使用します。

  • 成功(緑): 「完了」「アクティブ」「確認済み」。
  • 警告(黄/オレンジ): 「保留中」「在庫僅少」「下書き」。
  • エラー(赤): 「失敗」「重大」「在庫切れ」。
  • 情報/ニュートラル(青/グレー): 「新着」「カテゴリ」「メタデータ」。

ルール: 色覚異常のユーザーへのアクセシビリティを確保するため、常に色をテキストまたはアイコンと組み合わせて使用します。

4. インタラクティブ状態の定義

タグがインタラクティブな場合:

  • ホバー/フォーカス: 微妙な背景シフトまたは境界線の変更を適用します。
  • 削除可能: 明確な「X」アイコンを含め、最小ヒット領域は24x24px(WCAG 2.2 SC 2.5.8)とし、レイアウトが許せば44x44pxまで拡大して快適なタッチ操作を実現します。

5. 配置と階層の決定

  • オーバーレイ: 画像の上部コーナーに「新着」バッジを配置する。
  • インライン: page-header-system内のタイトルの直後にステータスバッジを配置する。
  • グループ化: card-ui-system内の説明の下に複数のタグを積み重ねる。

決定ルール

  • 「Squint Test(細目テスト)」: バッジが明るすぎてH1から注意をそらす場合は、彩度を下げるかアウトラインスタイルを使用します。
  • カウント制限: 視覚的な乱雑さを防ぐため、1つのカードに3つ以上のタグを使用しないでください。
  • テキスト長: ラベルは1〜2語に抑えてください。データが動的で予測不可能な場合は、切り詰めるかツールチップを使用してください。
  • ボタンとの区別: バッジには、「送信」や「購入」などのプライマリボタンとは異なるビジュアル表現(例:小さいサイズ、異なる半径)を与えてください。

制約条件

  • アクセシビリティ: バッジ/タグ内のテキストはWCAG AA(4.5:1コントラスト)を満たす必要があります。インタラクティブなタグはキーボードで操作可能でなければなりません。
  • レスポンシブ対応: グループ内のタグは、コンテナからはみ出さずに次の行に折り返す必要があります(flex-wrap: wrap)。
  • タッチターゲット: 削除可能なタグは、「閉じる」アクションのための十分な大きさのターゲットサイズ(WCAG 2.2 SC 2.5.8に準拠した最小24x24px、推奨44x44px)を持つ必要があります。

よくある失敗パターン

  • 「ボタンの模倣」: タグをボタンとまったく同じに見せることで、ユーザーにプライマリアクションを期待させてしまう。
  • 色への過度な依存: テキストラベルなしで赤・緑・黄のみを使用し、色覚異常者やスクリーンリーダーユーザーがステータスを理解できないようにしてしまう。
  • タグの乱用: 1枚のカードに10個以上のタグを詰め込み、どれも役に立たなくしてしまう。
  • 不統一な半径: 同じUI内でピル型のバッジと角の四角いタグが混在してしまう。

検証基準

  • バッジとタグがボタンと視覚的に区別されていること。
  • セマンティックカラーが一貫して使用されていること(例:緑は常に成功を意味する)。
  • すべての色のバリエーションでコントラスト比がWCAG AA(4.5:1)を満たしていること。
  • インタラクティブなタグにフォーカス状態と少なくとも24x24px(WCAG 2.2 SC 2.5.8)のタッチターゲットが含まれていること。
  • モバイルビューポートで要素が適切に折り返されること。
  • 重要なステータスインジケーターには、色と一緒にアイコンが使用されていること。

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 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 specify a systematic dark theme framework, establishing rules for elevation-based surface colors, desaturated brand accents, text legibility, and media adaptation to ensure an accessible, low-fatigue experience.

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.

関連スキル