{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "navigation",
  "status": "alpha",
  "import": "@senvenli/react/navigation",
  "name": "pagination",
  "title": "Pagination",
  "exports": [
    "Pagination"
  ],
  "description": "Moves through pages of results with page numbers, previous/next and a page-size choice.",
  "keywords": [
    "pagination",
    "pages",
    "paging",
    "results"
  ],
  "usage": {
    "when": [
      "A list or table with more results than fit one page."
    ],
    "instead": [
      {
        "use": "data-table",
        "when": "The rows already live in a table with paging built in."
      },
      {
        "use": "button",
        "when": "A single Load more continues a feed."
      }
    ]
  },
  "a11y": {
    "builtIn": [
      "The current page is marked; the range is announced (\"41–60 of 1,204\")."
    ],
    "youProvide": []
  },
  "related": [
    "toolbar"
  ],
  "genui": {
    "expose": true,
    "description": "Page controls for a long list. page is 1-based. Emits change.",
    "props": [
      "page",
      "pageSize",
      "total"
    ],
    "children": "none",
    "events": [
      "change"
    ],
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "number",
          "description": "1-based. Keep it in the URL so back and refresh return to it."
        },
        "pageSize": {
          "type": "number"
        },
        "total": {
          "type": "number",
          "description": "All items across pages."
        }
      },
      "required": [
        "page",
        "pageSize",
        "total"
      ]
    }
  },
  "source": [
    "src/navigation/pagination.tsx"
  ],
  "props": {
    "Pagination": [
      {
        "name": "page",
        "type": "number",
        "required": true,
        "origin": "own",
        "description": "1-based. Keep it in the URL so back and refresh return to it.",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "pageSize",
        "type": "number",
        "required": true,
        "origin": "own",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "total",
        "type": "number",
        "required": true,
        "origin": "own",
        "description": "All items across pages.",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "onPageChange",
        "type": "(page: number) => void",
        "required": true,
        "origin": "own"
      },
      {
        "name": "onPageSizeChange",
        "type": "(pageSize: number) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "pageSizeOptions",
        "type": "readonly number[]",
        "required": false,
        "origin": "own",
        "default": "[20, 50, 100]",
        "description": "20, 50 and 100 by default; the current size joins the list when it is not in it.",
        "schema": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      {
        "name": "formatRange",
        "type": "(from: number, to: number, total: number) => string",
        "required": false,
        "origin": "own",
        "description": "The range sentence naming the items: (41, 60, 1204) → \"41–60 of 1,204 orders\". It gets the\nraw numbers; format them for the locale yourself (Intl.NumberFormat)."
      }
    ]
  },
  "tokens": [
    "ds-background-neutral-hovered",
    "ds-background-neutral-pressed",
    "ds-background-neutral-subtle-hovered",
    "ds-border-focused",
    "ds-radius-control-medium",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-space-200",
    "ds-text",
    "ds-text-disabled",
    "ds-text-subtle"
  ],
  "strings": [
    "newTab",
    "nextPage",
    "pageN",
    "pageOf",
    "pages",
    "perPage",
    "previousPage",
    "rangeOf"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
