{
 "id": "pagination",
 "name": "Pagination",
 "purpose": "The footer under a long table: how many rows are showing, rows per page, and previous, next and page numbers that collapse to \"Page 3 of 49\" when narrow.",
 "use_when": [
  "under a long table",
  "under a list or search results long enough to split, where people need to know how many items there are and jump to a page"
 ],
 "avoid_when": [
  "a feed people scroll through without needing a page number: load more at the end instead",
  "moving between steps of one task: use setup-steps",
  "switching between views of one page: use page-header-tabs"
 ],
 "type": "navigation",
 "style": "dense",
 "width": "wide",
 "tags": {
  "audience": "work",
  "industries": [
   "any"
  ],
  "keywords": [
   "pagination",
   "pager",
   "table footer",
   "pages",
   "rows per page"
  ]
 },
 "root": ".odl-pagination",
 "parts": [
  {
   "name": "count",
   "selector": ".odl-count",
   "what": "which rows are showing out of how many",
   "slot": "text"
  },
  {
   "name": "rows_per_page",
   "selector": "select",
   "what": "a choice of how many rows each page shows",
   "slot": "input"
  },
  {
   "name": "previous",
   "selector": ".odl-step",
   "what": "Previous and Next buttons either side of the pages",
   "slot": "action"
  },
  {
   "name": "pages",
   "selector": ".odl-page",
   "what": "one page number; the current one is marked",
   "slot": "list"
  },
  {
   "name": "gap",
   "selector": ".odl-gap",
   "what": "an ellipsis where page numbers are skipped",
   "slot": "none"
  },
  {
   "name": "page_of",
   "selector": ".odl-of",
   "what": "'Page 3 of 49', shown instead of the numbers when narrow",
   "slot": "text"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "current_page",
   "total_pages"
  ],
  "properties": {
   "first_row": {
    "type": "integer",
    "minimum": 1,
    "part": "count"
   },
   "last_row": {
    "type": "integer",
    "minimum": 1,
    "part": "count"
   },
   "total_rows": {
    "type": "integer",
    "minimum": 0,
    "part": "count"
   },
   "page_sizes": {
    "type": "array",
    "minItems": 2,
    "maxItems": 5,
    "part": "rows_per_page",
    "items": {
     "type": "integer",
     "minimum": 1
    }
   },
   "page_size": {
    "type": "integer",
    "minimum": 1,
    "part": "rows_per_page"
   },
   "current_page": {
    "type": "integer",
    "minimum": 1,
    "part": "pages"
   },
   "total_pages": {
    "type": "integer",
    "minimum": 1,
    "part": "page_of"
   },
   "visible_pages": {
    "type": "array",
    "minItems": 1,
    "maxItems": 7,
    "part": "pages",
    "items": {
     "type": "object",
     "properties": {
      "current": {
       "type": "integer",
       "minimum": 1
      },
      "kind": {
       "enum": [
        "page"
       ]
      }
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "current page",
   "hover",
   "focus",
   "disabled",
   "narrow"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if a page fails to load, stay on the current page and show the reason in alert-banners above the table"
   },
   "disabled": {
    "status": "handled",
    "how": "a disabled Previous or Next turns grey with a not-allowed cursor, for the first and last page; the sample shows page 3, so neither is disabled",
    "evidence": ".odl-step:disabled"
   },
   "overflow": {
    "status": "handled",
    "how": "under 900px the page numbers give way to 'Page 3 of 49'; under 520px the count and the pager each take a full row",
    "evidence": "@container (max-width: 900px)"
   },
   "long_text": {
    "status": "handled",
    "how": "the count, the rows label and 'Page 3 of 49' never wrap; the bar wraps its groups instead",
    "evidence": "white-space: nowrap"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-field",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-input",
  "--ds-color-border-subtle",
  "--ds-color-icon-subtle",
  "--ds-color-surface-raised",
  "--ds-color-text-disabled",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-body",
  "--ds-font-weight-heading",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-hover",
  "--ds-radius-control",
  "--ds-size-control-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-stack-md",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md"
 ],
 "a11y": {
  "summary": "A navigation landmark named Pagination; the current page has aria-current, page buttons have full names, the ellipsis is hidden from screen readers and the row count is a polite live region.",
  "roles": [
   "list",
   "navigation"
  ],
  "keyboard": [
   "Tab reaches the rows-per-page choice, Previous, each page number, then Next",
   "Arrow keys change the rows-per-page choice, as in any native select",
   "Enter or Space presses the focused button; the file has no script, so pages do not change until the project wires them"
  ],
  "controls": {
   "button": 9,
   "input": 0,
   "link": 0,
   "select": 1,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/pagination/component.html",
  "bytes": 8143,
  "script": false
 },
 "source": null,
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/pagination.html",
  "json": "https://opendesigner.dev/library/pagination.json",
  "page": "https://opendesigner.dev/library/pagination/"
 },
 "get": {
  "curl": "curl -fsSLo pagination.html https://opendesigner.dev/library/pagination.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add pagination --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component pagination to this project: https://opendesigner.dev/library/pagination.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
