{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pagination",
  "type": "registry:ui",
  "title": "Pagination",
  "description": "Links to the previous, next and numbered pages of a long list, with the look of buttons.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "class-variance-authority",
    "lucide-react",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/button",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/pagination.tsx",
      "type": "registry:ui",
      "target": "components/ui/pagination.tsx",
      "content": "/**\n * @name pagination\n * @category ui\n * @description Links to the previous, next and numbered pages of a long list, with the look of buttons.\n * @when A list or table split over pages that people may want to jump within or link to. Each page is a real link, so it works without JavaScript; with a router link, pass it through `asChild`. On the first or last page give PaginationPrevious or PaginationNext `aria-disabled=\"true\"` and no `href`. For a feed with no natural page numbers use a \"Load more\" button.\n * @example\n * <Pagination>\n *   <PaginationContent>\n *     <PaginationItem><PaginationPrevious href=\"?page=1\" /></PaginationItem>\n *     <PaginationItem><PaginationLink href=\"?page=1\">1</PaginationLink></PaginationItem>\n *     <PaginationItem><PaginationLink href=\"?page=2\" isActive>2</PaginationLink></PaginationItem>\n *     <PaginationItem><PaginationEllipsis /></PaginationItem>\n *     <PaginationItem><PaginationLink href=\"?page=9\">9</PaginationLink></PaginationItem>\n *     <PaginationItem><PaginationNext href=\"?page=3\" /></PaginationItem>\n *   </PaginationContent>\n * </Pagination>\n */\nimport { Slot } from \"radix-ui\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { ChevronLeft, ChevronRight, Ellipsis } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/cn\";\n\n/** The landmark. `aria-label` is \"Pagination\" unless you translate it. */\nexport function Pagination({ className, \"aria-label\": label = \"Pagination\", ...props }: ComponentProps<\"nav\">) {\n  return <nav data-slot=\"pagination\" aria-label={label} className={cn(\"mx-auto flex w-full justify-center\", className)} {...props} />;\n}\n\nexport function PaginationContent({ className, ...props }: ComponentProps<\"ul\">) {\n  return <ul data-slot=\"pagination-content\" className={cn(\"flex flex-wrap items-center justify-center gap-1\", className)} {...props} />;\n}\n\nexport function PaginationItem(props: ComponentProps<\"li\">) {\n  return <li data-slot=\"pagination-item\" {...props} />;\n}\n\nexport type PaginationLinkProps = ComponentProps<\"a\"> &\n  Pick<VariantProps<typeof buttonVariants>, \"size\"> & {\n    /** The page being shown: outlined, and marked `aria-current=\"page\"`. */\n    isActive?: boolean;\n    /** Render the child element (a router link, for example) with the link's look. */\n    asChild?: boolean;\n  };\n\nexport function PaginationLink({ className, isActive = false, size = \"icon\", asChild = false, ...props }: PaginationLinkProps) {\n  const Comp = asChild ? Slot.Root : \"a\";\n  return (\n    <Comp\n      data-slot=\"pagination-link\"\n      data-active={isActive || undefined}\n      aria-current={isActive ? \"page\" : undefined}\n      className={cn(\n        buttonVariants({ variant: isActive ? \"outline\" : \"ghost\", size }),\n        \"tabular-nums aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\ntype PaginationStepProps = Omit<PaginationLinkProps, \"size\" | \"isActive\" | \"children\"> & {\n  /** The visible text, shown from `sm` up. It is also the accessible name unless `aria-label` is set. */\n  label?: string;\n};\n\n/** Icon-only on phones, so it always carries an `aria-label`. */\nexport function PaginationPrevious({ className, label = \"Previous\", \"aria-label\": ariaLabel, ...props }: PaginationStepProps) {\n  return (\n    <PaginationLink data-slot=\"pagination-previous\" aria-label={ariaLabel ?? `${label} page`} size=\"md\" className={cn(\"gap-1 px-2.5\", className)} {...props}>\n      <ChevronLeft aria-hidden=\"true\" strokeWidth={1.5} className=\"rtl:rotate-180\" />\n      <span className=\"hidden sm:inline\">{label}</span>\n    </PaginationLink>\n  );\n}\n\n/** Icon-only on phones, so it always carries an `aria-label`. */\nexport function PaginationNext({ className, label = \"Next\", \"aria-label\": ariaLabel, ...props }: PaginationStepProps) {\n  return (\n    <PaginationLink data-slot=\"pagination-next\" aria-label={ariaLabel ?? `${label} page`} size=\"md\" className={cn(\"gap-1 px-2.5\", className)} {...props}>\n      <span className=\"hidden sm:inline\">{label}</span>\n      <ChevronRight aria-hidden=\"true\" strokeWidth={1.5} className=\"rtl:rotate-180\" />\n    </PaginationLink>\n  );\n}\n\n/** Stands for the pages left out between two numbers. */\nexport function PaginationEllipsis({ className, label = \"More pages\", ...props }: ComponentProps<\"span\"> & { label?: string }) {\n  return (\n    <span data-slot=\"pagination-ellipsis\" className={cn(\"inline-flex size-(--control-h) items-center justify-center text-muted-foreground\", className)} {...props}>\n      <Ellipsis aria-hidden=\"true\" strokeWidth={1.5} className=\"size-4\" />\n      <span className=\"sr-only\">{label}</span>\n    </span>\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "A list or table split over pages that people may want to jump within or link to. Each page is a real link, so it works without JavaScript; with a router link, pass it through `asChild`. On the first or last page give PaginationPrevious or PaginationNext `aria-disabled=\"true\"` and no `href`. For a feed with no natural page numbers use a \"Load more\" button.",
    "example": "<Pagination>\n  <PaginationContent>\n    <PaginationItem><PaginationPrevious href=\"?page=1\" /></PaginationItem>\n    <PaginationItem><PaginationLink href=\"?page=1\">1</PaginationLink></PaginationItem>\n    <PaginationItem><PaginationLink href=\"?page=2\" isActive>2</PaginationLink></PaginationItem>\n    <PaginationItem><PaginationEllipsis /></PaginationItem>\n    <PaginationItem><PaginationLink href=\"?page=9\">9</PaginationLink></PaginationItem>\n    <PaginationItem><PaginationNext href=\"?page=3\" /></PaginationItem>\n  </PaginationContent>\n</Pagination>",
    "client": false
  }
}
