Communitygithub.com

底部導航系統

設計響應式、行動優先的底部導航列與持久動作底座系統,適用於行動網站與網頁應用程式,建立空間錨點、分頁列結構、徽章指示器、拇指區域人體工學、安全區域內縮處理、啟用/停用狀態對比,以及桌面響應式適配規則。

底部導航系統 是什麼?

這個「底部導航系統」技能提供了一套標準化、行動優先的設計框架,專門用於在行動網頁介面和漸進式網頁應用程式(PWA)中建立底部導航列、分頁列和持久動作底座。現代行動裝置的大長寬比將頂部頁首置於單手可及範圍(「拇指區域」)之外,而底部導航則將主要應用程式目的地和關鍵轉換動作直接錨定在用戶拇指自然可及的範圍內。設計有效的底部導航系統需要平衡項目密度(3 到 5 個項目)、啟用/停用狀態的視覺層級、觸控目標尺寸、徽章指示器位置、 viewport 安全區域內縮(`env(safe-area-inset-bottom)`)、浮動動作按鈕(FAB)整合,以及無縫的桌面適配規則。此技能將行動 UX 設計與技術執行緊密結合,並嚴格遵守 WCAG AA 無障礙標準。它支援在各種平台(如 e-commerce、SaaS、社交平台、物流服務和現場作業表格)上建立直覺且易於操作的底部導航體驗。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/bottom-navigation-system

在你喜歡的 AI 中提問

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

說明文件

底部導航系統 是做什麼的?

目的

底部導航系統提供了一個標準化、行動優先的設計框架,用於在行動網頁介面和漸進式網頁應用程式(PWA)中建立底部導航列、分頁列和持久動作底座。現代行動裝置的大長寬比將頂部頁首置於單手可及範圍(「拇指區域」)之外。底部導航將主要應用程式目的地和關鍵轉換動作直接錨定在用戶拇指自然可及的範圍內。

設計有效的底部導航系統需要平衡項目密度(3 到 5 個項目)、啟用/停用狀態的視覺層級、觸控目標尺寸、徽章指示器位置、viewport 安全區域內縮(env(safe-area-inset-bottom))、浮動動作按鈕(FAB)整合,以及無縫的桌面適配規則。此技能將行動 UX 設計與技術執行緊密結合,並嚴格遵守 WCAG AA 無障礙標準。

使用案例

  • 電子商務行動網頁應用程式: 提供即時 1 指點擊拇指存取首頁、搜尋/瀏覽、已儲存項目、購物車(含項目計數徽章)和帳戶。
  • SaaS 行動網頁應用程式與 PWA: 為行動生產力應用程式(例如,今日任務、動態、快速新增 [+]、訊息、設定)構建主要導覽。
  • 社交與內容平台: 管理首頁動態、探索、建立/上傳、活動通知和用戶個人檔案之間的高頻切換。
  • 隨選與物流網頁服務: 在主動追蹤期間,將主要狀態分頁(訂單、運送中地圖、收件匣、個人檔案)固定在底部 viewport。
  • 現場作業與檢查表單: 在長行動表單底部固定持久動作按鈕(儲存草稿、上傳照片、提交表單)。

何時不該使用

  • 桌面優先的企業網頁應用程式: 對於寬螢幕佈局(>1024px),垂直側邊欄或頂部頁首列能提供更好的空間效率,請使用 sidebar-navigation-system 或 site-navigation-system。
  • 頁內內容切換: 若要在特定頁面區段或卡片內切換檢視或篩選內容,請使用 tab-ui-system 或 segmented-control-system。
  • 情境動作表單與模態視窗: 對於在頁面內容上彈出的臨時、特定任務的覆蓋面板,請使用 accessible-bottom-sheet-implementation 或 overlay-and-dialog-system。
  • 浮動次要動作觸發器: 對於單一的浮動說明按鈕、返回頂部按鈕或聊天氣泡,請使用 sticky-and-floating-ui-system。

輸入

  1. 資訊架構(IA)分類法: 頂層主要目的地的列表(最多 3–5 個項目)及其圖示/標籤元數據。
  2. 通知與徽章需求: 未讀指示器的規格(圓點徽章 vs. 數字計數徽章)。
  3. 主要動作突顯(可選): 中間欄位是否需要一個凸起的浮動動作按鈕(FAB)來執行主要的建立動作。
  4. 設計 Token: 調色盤、高度/陰影 Token、流暢排版、圖示集和間距變數(來自 accessible-color-system、elevation-and-depth-system 和 iconography-system)。
  5. 響應式桌面策略: 桌面適配模式的選擇(在桌面上隱藏、停靠到側邊欄或轉換為頂部導覽)。

輸出

  1. 底部導航列結構規格: 詳細的佈局藍圖,定義項目寬度、圖示到標籤的垂直堆疊、排版 Token、徽章放置座標,以及包含安全區域內距的高度計算。
  2. 互動狀態 Token 對應: 預設/停用、啟用/選取、懸停、焦點可見和已停用項目的顏色對比定義與視覺狀態。
  3. 拇指區域無障礙對應: 空間放置規則,將最高頻率的分頁最佳化至中心拇指可及區域。
  4. 安全區域與 Viewport 內縮指南: 使用 env(safe-area-inset-bottom) 處理無邊框行動顯示器凹口區域(iOS 主畫面指示器與 Android 手勢列)的 CSS 實作規則。
  5. 響應式斷點與桌面轉換藍圖: 用於在平板和桌面螢幕上隱藏或轉換底部列的響應式 media query 與佈局規則。

工作流程

1. 建立項目數量與空間網格

將底部導航列限制為 3 到 5 個頂層項目:

  • 3 個項目: 等寬 flex 分佈(width: 33.33%)。最適合具有不同核心檢視的緊湊網頁應用程式。
  • 4 個項目: 等寬 flex 分佈(width: 25%)。電子商務和 SaaS 行動應用程式的理想平衡。
  • 5 個項目: 等寬 flex 分佈(width: 20%)。行動螢幕寬度(320px–430px)的建議最大限制。
  • 5 項規則: 永遠不要超過 5 個項目。如果有 6 個以上的目的地,將次要頁面分組到「更多」或「帳戶」選單分頁下,或將優先權較低的連結移到側抽屜。

2. 定義垂直結構與高度 Token

建構一個固定在 viewport 底部的容器:

  • 容器定位: 使用 position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;。
  • 基礎高度: 為標準分頁列設定 56px 到 64px 的基礎內容高度,再加上 padding-bottom: env(safe-area-inset-bottom, 0px),以防止觸控被 iOS 主畫面指示器或 Android 手勢操作桿遮擋。
  • 項目堆疊佈局:
    • 圖示大小: 標準化為 24x24px SVG 圖示(iconography-system)。
    • 標籤排版: 使用 11px 到 12px 字體大小(font-size: 0.75rem; font-weight: 500; line-height: 1.2)。
    • 垂直間距: 將圖示置於頂部(頂部內距 4px),圖示和標籤之間間距 2px,底部內距 4px。
    • 觸控目標地板: 確保每個分頁項目提供全高、全寬的觸控區域(min-height: 48px、min-width: 48px)。

3. 建立啟用與停用狀態層級

在啟用分頁和停用分頁之間實施強烈的視覺對比:

  • 停用狀態:
    • 圖示填色/描邊:微妙的次要顏色(例如 var(--text-tertiary, #6B7280))。
    • 標籤顏色:次要文字顏色(var(--text-secondary, #4B5563))。
    • 字體粗細:一般或中等(400 或 500)。
  • 啟用/選取狀態:
    • 圖示填色/描邊:品牌主要或高對比強調色(var(--brand-primary, #2563EB))。如果可用,使用填滿的圖示變體。
    • 標籤顏色:主要文字或品牌顏色(var(--text-primary, #111827) 或 var(--brand-primary))。
    • 字體粗細:半粗體(600)。
    • 啟用指示器(可選):一個 3px 的頂部邊框或藥丸指示器(background: var(--brand-primary)),或一個微妙的背景膠囊填色(var(--brand-subtle, #EFF6FF))。
  • 對比度要求: 確保停用文字和啟用文字都符合 WCAG AA 最小對比度比率(相對於列的背景顏色為 4.5:1)。

4. 整合徽章與通知指示器

徽章通知使用者有關未讀訊息、待處理動作或購物車項目數量的資訊:

  • 徽章定位: 徽章相對於分頁 24x24px 圖示容器的右上角定位(position: absolute; top: -2px; right: -6px;)。
  • 圓點徽章(未讀指示器): 8x8px 實心圓形點(background: var(--badge-danger, #EF4444))。
  • 數字徽章(計數指示器): 藥丸徽章(height: 16px; min-width: 16px; padding: 0 4px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #FFFFFF; background: var(--badge-danger);)。將超過 99 的計數截斷為 99+。
  • 無障礙文字: 始終在徽章內部或旁邊包含僅供螢幕閱讀器使用的無障礙文字(<span class="sr-only">3 則未讀通知</span>)。

5. 處理 Viewport 安全區域與表面樣式

確保底部導航表面在滾動內容上保持可讀性:

  • 背景模糊與半透明: 應用半透明表面背景與背景濾鏡(background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border-top: 1px solid var(--border-subtle, #E5E7EB);)。對於深色模式,使用(background: rgba(17, 24, 39, 0.85))。
  • 安全區域內縮規則: 使用 CSS:
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      padding-bottom: env(safe-area-inset-bottom, 0px);
      background: var(--nav-bg);
      border-top: 1px solid var(--nav-border);
    }
    
  • 頁面底部間距: 為主要可滾動主體容器添加底部內距,其值等於底部列高度加上安全區域內縮(padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px))),以防止內容被固定列截斷。

6. 實作響應式桌面適配

底部導航列針對觸控螢幕進行了最佳化,在寬桌面 viewport(>1024px)上拉伸會顯得不自然。

  • 斷點策略:
    • 行動裝置(<768px): 渲染固定的底部導航列。
    • 平板裝置(768px – 1023px): 將底部列保持置中/約束(max-width: 480px; margin: 0 auto; border-radius: 16px 16px 0 0;)或轉換為頂部頁首。
    • 桌面裝置(≥1024px): 隱藏底部導航列(display: none)。主要目的地轉換到頂部頁首導覽(site-navigation-system)或垂直側邊欄(sidebar-navigation-system)。

決策規則

底部列佈局模式的選擇

模式項目結構理想使用案例關鍵互動
標準分頁列3 到 5 個等寬項目,附圖示 + 文字標籤。電子商務、SaaS 導覽、內容入口。1 指點擊立即檢視導覽。
置中 FAB 底座4 個分頁 + 1 個凸起的中央動作按鈕(例如「+ 建立」)。社交發文、任務追蹤、媒體創作應用程式。中央按鈕開啟建立模態視窗/表單;外部分頁導覽檢視。
標籤式圖示列4–5 個項目,帶有持久圖示和可見的 11px 文字標籤。大多數行動網頁應用程式的預設值;最高的可用性與清晰度。無需猜測圖示即可立即辨識。
僅圖示緊湊列4–5 個項目,僅有圖示(標籤出現在 aria-label 中)。高度熟悉的消費者應用程式(例如類似 Instagram 的介面)。謹慎使用: 僅在圖示被普遍辨識時使用。

徽章樣式選擇

  • 圓點徽章(紅色/強調色圓點): 當使用者需要知道「有新活動」,但確切數量無關緊要時使用(例如,有新部落格文章、系統更新)。
  • 數字徽章(計數): 當確切項目計數會直接影響使用者動作時使用(例如,「購物車中有 3 個項目」、「5 則未讀訊息」)。

限制條件

  • 無障礙(WCAG 2.1 / 2.2 AA):
    • SC 2.1.1 鍵盤無障礙: 底部導航分頁必須使用標準的 <nav> 搭配語義化的 <a> 連結或 <button role="tab"> 控制項來實作,並可透過 Tab 鍵或 Arrow 鍵進行導覽。
    • SC 2.4.7 焦點可見: 聚焦的底部導航項目必須顯示一個未被裁剪的焦點環,且與背景的對比度至少為 3:1。
    • SC 2.5.8 目標尺寸(最小): 觸控目標必須至少測量 48x48px(或 24x24px,且周圍間距確保 48px 的觸控區域)。
    • SC 1.4.3 視覺對比: 停用分頁標籤和圖示必須與背景填色維持至少 4.5:1 的對比度。
  • 滾動行為: 底部導航列必須在觸控慣性滾動期間可靠地固定(position: fixed),不會出現閃爍或垂直抖動。
  • 安全區域內縮: 必須包含 env(safe-area-inset-bottom),以避免與基於手勢的行動 viewport 的硬體主畫面指示器重疊。

常見失敗模式

  • 缺少安全區域間距: 未能應用 env(safe-area-inset-bottom),導致底部導航標籤被 iOS 手勢列或螢幕裁切區域重疊。
  • 項目密度過高: 強行將 6 或 7 個項目塞入底部列,將觸控目標壓縮到 40px 以下,導致頻繁的意外誤觸。
  • 拉伸的桌面列: 允許 4 個項目的底部列在桌面顯示器上橫跨 1920px 寬,圖示之間出現巨大的空白間距。
  • 無標籤的神秘圖示: 省略模糊圖示的文字標籤(例如,使用星形圖示卻未標明它是「最愛」、「評論」或「獎勵」)。
  • 固定導覽後方的內容截斷: 忘記為頁面容器添加 padding-bottom,導致頁尾內容和主要表單提交按鈕永久地被固定的底部列遮擋。

驗證標準

  • 底部導覽包含 3 到 5 個主要目的地。
  • 每個分頁提供的觸控目標區域達到或超過 48x48px。
  • 啟用和停用狀態在視覺上截然不同,並通過 WCAG AA 4.5:1 對比度要求。
  • CSS 包含 padding-bottom: env(safe-area-inset-bottom) 以支援安全區域內縮。
  • 主要頁面內容容器包含底部內距,使頁面內容永遠不會隱藏在固定列後方。
  • 徽章包含無障礙的僅供螢幕閱讀器使用的文字(例如 sr-only)。
  • 導覽可完全透過鍵盤(Tab 和 Shift+Tab 或 Arrow 鍵,具有清晰的 :focus-visible 指示器)到達。
  • 在 viewport ≥1024px 時,底部列會乾淨地隱藏或轉換為桌面頁首或側邊欄。

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 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.

相關技能