Communitygithub.com

ページネーションシステム

大規模なコンテンツコレクションを効率的にナビゲートするための体系的なフレームワークを設計・実装します。明確な方向性、アクセシビリティ、スムーズな移動を保証します。

ページネーションシステム とは?

このスキルは、大量のデータセットを個別のページに分割するインターフェースを設計するための方法論を提供します。ユーザーがアイテムの長いリスト(商品、検索結果、記事)を移動しながら、自分がどこにいて、残りがどれだけあるかを明確に把握できるようにします。堅牢なページネーションシステムは、ナビゲーションの正確性とシンプルさのバランスを取り、認知負荷を最小限に抑え、ユーザーの混乱を防ぎます。eコマースやディレクトリサイトの検索結果ページ、ブログやニュースアーカイブの整理、データが多いダッシュボードテーブルやログのナビゲーションに最適です。小規模なデータセットや無限スクロールが適切なコンテキストでの使用は避けるべきです。このスキルは、ページ番号、Previous/Nextボタン、ジャンプコントロールの視覚スタイル、各状態のマトリックス、レスポンシブ戦略、ARIAロールやラベル、キーボード操作パターンを含むアクセシビリティマップを出力します。

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

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

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

ドキュメント

ページネーションシステム は何をしますか?

目的

ページネーションシステムスキルは、大規模なデータセットを個別のページに分割するインターフェースを設計するための方法論を提供します。これにより、ユーザーはアイテムの長いリスト(商品、検索結果、記事)を移動しながら、「現在地」と「残りのコンテンツ量」を明確に把握できます。堅牢なページネーションシステムは、ナビゲーションの正確性とシンプルさのバランスを取り、認知負荷を最小限に抑え、ユーザーの混乱を防ぎます。

ユースケース

  • eコマースやディレクトリサイトの検索結果ページの設計。
  • 長いブログやニュースアーカイブの整理。
  • コンテンツハブにおける「Load More」と従来の番号付きページネーションの実装。
  • データ量の多いダッシュボードテーブルやログのナビゲーション作成。
  • 個々のセクションを個別のビューとして扱うマルチページフォームやステップベースのウィザードの最適化。

使用すべきでない場合

  • 小規模データセット(12アイテム未満): すべてのコンテンツが1〜2画面に収まる場合、ページネーションは不要なクリックと摩擦を追加します。
  • 無限スクロールのコンテキスト: 特定のページアドレスが重要でない、発見重視のソーシャルフィードやニュースストリームをユーザーが探索している場合(代わりに infinite-scroll-implementation を使用してください)。
  • 単一のナラティブコンテンツ: 「前へ/次へ」リンクで十分な線形フローに沿った記事やストーリーの場合。

入力

  1. 総アイテム数: コレクション内のアイテムの総数はいくつですか?
  2. 1ページあたりのアイテム数: 標準的な密度はいくつですか(例:12、24、48アイテム)?
  3. 現在のページコンテキスト: ユーザーは現在どのページを表示していますか?
  4. 表示の制約: ページネーションバーに利用可能な水平スペースはどれくらいですか(responsive-grid-system より)?

出力

  1. ページネーション構造仕様: ページ番号、前へ/次へボタン、および「ジャンプ」コントロール(省略記号)の定義された視覚スタイル。
  2. 状態マトリックス: デフォルト、現在、ホバー、フォーカス、および無効(例:1ページ目の「前へ」ボタン)状態の視覚的な処理。
  3. レスポンシブ戦略: ページネーションバーがデスクトップ(全範囲)からモバイル(コンパクト表示)に縮小する計画。
  4. アクセシビリティマップ: ARIAロール、ラベル、キーボード操作パターンの明示的な定義。

ワークフロー

1. 範囲戦略を定義する

総量に基づいて、一度に表示するページ番号の数を決定します。

  • シンプル(3〜5ページ): すべてのページ番号を表示。
  • 中程度(6〜10ページ): 最初と最後、および現在のページの周りのウィンドウを表示。
  • 複雑(10ページ以上): 省略記号(...)を使用してスキップされた範囲を表します(例:1 ... 4 5 6 ... 20)。

2. ナビゲーションコントロールを設計する

ページネーションバーの視覚的な階層を確立します。

  • 主要アクション: 前へボタンと次へボタンは明確に表示され、バーの端に配置する必要があります。
  • 現在のページインジケーター: 現在のページをすぐに認識できるように、ハイコントラストなスタイル(背景色または太い枠線)を使用します。
  • ページ番号: インタラクティブな要素のように見えるようにします(例:interactive-state-system を使用)。

3. 流動的なスペーシングとサイズを適用する

fluid-spacing-system を使用して、ターゲットが使いやすいことを確認します。

  • タップターゲット: すべてのページ番号とボタンは少なくとも44x44pxである必要があります。視覚的な密度のために小さいコントロールが必要な場合、WCAG 2.2(2.5.8 ターゲットサイズ最小値)は、偶発的なアクティベーションを避けるために、ターゲット間に適切な間隔を空けた24x24pxの絶対的な下限を設定します。
  • 内部ギャップ: 誤クリックを避けるために、ページ番号間には一貫した間隔(例:--space-xs)を使用します。

4. アクセシビリティを確立する(WCAG AA/AAA)

  • ランドマーク: ページネーションを aria-label="pagination" を持つ <nav> 要素でラップします。
  • 現在のページ: アクティブなページリンクに aria-current="page" を使用します。
  • 無効状態: 最初のページにある場合、「前へ」ボタンが視覚的およびプログラム的に無効になっていることを確認します(例:aria-disabled="true")。
  • キーボードパス: ユーザーが各ページ番号とコントロールを Tab で移動できる必要があり、フォーカスされたコントロールが固定ヘッダー/フッターによって完全に隠されてはなりません(WCAG 2.2、2.4.11 フォーカスが隠されていない)。

5. レスポンシブ適応を計画する

デスクトップからモバイルへの移行をマッピングします。

  • 削減ルール: モバイルでは、ほとんどのページ番号を非表示にし、「前へ」、「次へ」、および現在のステータス(例:「4/20ページ」)のみを表示します。
  • 視覚的なスケール: ページ番号を残す必要がある場合は、「ウィンドウ」を現在のページとそのすぐ隣のページに減らします(例:1 ... 4 ... 20)。

決定ルール

  • 数字 vs. Load More: ユーザーが特定の結果をブックマークまたは共有する必要がある場合(例:「4ページをチェック」)は数字を使用します。目標が長期間の発見と比較である場合は「Load More」を使用します。
  • 「7アイテム」の最大値: デスクトップでは、レイアウトをすっきり保つために、ページネーションバーに7〜9アイテム(省略記号とボタンを含む)を超えて表示しないようにします。
  • 予測可能性: 「前へ」は常に左側、「次へ」は常に右側に配置します。これらのボタンを非表示にしないでください。適用できない場合は無効にするだけです。
  • 即時フィードバック: ページ番号をクリックすると、すぐにユーザーをコンテンツリストの先頭にスクロールするか、明確な「読み込み中」状態を提供する必要があります。

制約

  • アクセシビリティ: ページネーションはキーボードでナビゲート可能で、スクリーンリーダー対応である必要があります。ラベルは説明的である必要があります(例:「5」ではなく「5ページに移動」)。インタラクティブなターゲットは、少なくともWCAG 2.2の24x24pxの最小値(2.5.8)を満たす必要があり、主要な前へ/次へのコントロールには44x44pxが推奨されます。
  • レスポンシブ性: ページネーションバーは、水平方向のオーバーフローや他のUI要素との重なりを引き起こしてはなりません。
  • 視覚的な階層: ページネーションはコンテンツと視覚的に区別できる必要がありますが、コンテンツ自体よりも目立ってはなりません。

一般的な失敗パターン

  • 小さなタップターゲット: モバイルで正確にタップできない、小さく密集した数字。
  • 見えないアクティブ状態: 「アクティブ」スタイルが微妙すぎて、ユーザーがどのページにいるかわからない。
  • 壊れたキーボードループ: AJAXを介してページコンテンツが更新されたときにフォーカスを処理し忘れる(ユーザーを結果の先頭に移動する必要があります)。
  • 「モバイル爆発」: モバイル画面に10個のページ番号を表示しようとすると、水平スクロールやレイアウトの破損を引き起こす。
  • 曖昧なラベル: aria-label なしで数字のみを使用すると、スクリーンリーダーユーザーがコンテキストを理解するのが難しくなる。

検証基準

  • 現在のページが視覚的に区別され、aria-current="page" を持っている。
  • ナビゲーションが説明的な aria-label を持つ <nav> でラップされている。
  • タップターゲットが少なくともWCAG 2.2の24x24pxの最小値(主要な前へ/次へのコントロールは44x44px)を満たしている。
  • 無効状態(1ページ目の前へ、最終ページの次へ)が明確で、プログラム的に定義されている。
  • レスポンシブ動作が定義されている(モバイル用のコンパクトビュー)。
  • キーボードユーザーがページネーションバー全体をナビゲートできる。
  • 大きな範囲に対して省略記号が正しく使用されている。

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.

関連スキル