Communitygithub.com

coastdigitalgroup/coastai-skills

設計並實作一套針對資訊型元素的系統化框架,以清晰且無障礙的方式呈現狀態(徽章)與分類(標籤)。

coastai-skills 是什麼?

這項技能提供了一套完整的方法論,用於設計和實作具有資訊傳達功能的 UI 元件,例如顯示狀態的徽章(Badges)與用於分類的標籤(Tags)。它確保這些次要元素不搶走主要內容的風采,同時保持極高的掃描性、可訪問性以及邏輯一致性,適用於任何網站或應用程式。此技能會引導使用者區分徽章與標籤的用途,建立它們的視覺尺寸、排版與圓角規範,並將特定的語意顏色(如成功、警告、錯誤、資訊)賦予明確的意義,以利使用者快速理解。對於可互動的標籤,它還詳細說明了懸停、焦點以及可移除(帶有「X」圖示)的互動狀態設計,並遵循無障礙規範(如 WCAG 2.2 的觸控目標要求)。此技能特別適合用於 Cursor、Claude Code 或 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 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

徽章與標籤系統

目的

徽章與標籤系統提供了一套方法論,用於設計和實作小型、資訊型的元件,以提供快速的脈絡、狀態或分類資訊。此技能確保這些元素在網站上保持輔助性,同時具備可快速掃描、無障礙且邏輯組織的特性。

使用案例

  • 狀態指示器: 顯示物件的狀態(例如「啟用中」、「待處理」、「已售罄」)。
  • 分類: 按主題、類型或系列標記內容(例如「生產力」、「教學」、「新品上市」)。
  • 數量/計數: 顯示與項目相關的數字(例如「12 則通知」、「購物車 5 件商品」)。
  • 篩選條件顯示: 顯示使用者可以移除的啟用中的篩選條件。
  • 優先級信號: 突顯特定屬性,如「暢銷商品」或「緊急」。

何時不應使用

  • 主要操作: 勿將徽章或標籤用作主要行動呼籲(CTA);請使用 interactive-state-system 中的按鈕。
  • 大型內容區塊: 如果資訊需要超過 2-3 個詞,請使用 card-ui-system 或標準排版。
  • 導航: 雖然標籤可以導向篩選後的檢視,但不應取代主要的 site-navigation-system。
  • 純裝飾用圖示: 如果元件沒有語意意義,它應歸屬於 iconography-system。

輸入

  1. 內容意圖: 是狀態(狀態)、分類(後設資料)還是計數(數字)?
  2. 互動需求: 元件是靜態的,還是可移除或可點擊的?
  3. 層級脈絡: 父元素是什麼?(例如卡片、頁首、表格列)。
  4. 色彩 Token: 現有的語意色彩尺度(Success、Warning、Error、Info)。

輸出

  1. 視覺解剖規範: 邊框圓角(藥丸形 vs. 圓角形)、內邊距和排版的定義。
  2. 語意色彩矩陣: 將顏色對應到特定意義(例如綠色 = Success)。
  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 的描述下方堆疊多個標籤。

決策規則

  • 「瞇眼測試」: 如果徽章過於明亮而干擾 H1 的閱讀,請降低其飽和度或使用輪廓樣式。
  • 限制數量: 每張卡片上不要使用超過 3 個標籤,以避免視覺混亂。
  • 文字長度: 將標籤限制在 1-2 個詞。如果資料是動態且不可預測的,請截斷文字或使用工具提示。
  • 與按鈕區別: 徽章應採用與主要「提交」或「購買」按鈕不同的視覺處理(例如較小的尺寸、不同的圓角半徑)。

限制

  • 可訪問性: 徽章/標籤內的文字必須符合 WCAG AA(4.5:1 對比度)。互動式標籤必須可透過鍵盤導航。
  • 響應式設計: 一組標籤應換行到下一個空白行(flex-wrap: wrap),而非溢出容器。
  • 觸控目標: 可移除標籤必須為「關閉」操作提供足夠大的目標區域(最低 24x24px,依據 WCAG 2.2 SC 2.5.8;建議 44x44px)。

常見失敗模式

  • 「按鈕模仿」: 讓標籤看起來完全像按鈕,導致使用者期望執行主要操作。
  • 過度依賴顏色: 使用紅/綠/黃色但沒有文字標籤,使得色盲或螢幕閱讀器使用者無法理解狀態。
  • 標籤湯: 在一張卡片上塞入 10 個以上的標籤,導致沒有一個有用。
  • 圓角不一致: 在同一個 UI 中混合使用藥丸形徽章和方形邊角標籤。

驗證標準

  • 徽章和標籤在視覺上與按鈕有區別。
  • 語意顏色的使用一致(例如綠色始終表示 Success)。
  • 所有顏色變體的對比度均符合 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.

相關技能