{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pagination",
  "type": "registry:ui",
  "title": "Pagination",
  "description": "Page navigation with previous/next, page numbers, and ellipsis truncation for long ranges.",
  "dependencies": [
    "@saasflare/ui"
  ],
  "files": [
    {
      "path": "components/ui/pagination.tsx",
      "type": "registry:ui",
      "content": "// @toreview\n\"use client\"\n\n/**\n * @fileoverview Pagination primitive — page navigation controls with previous/next links and ellipsis.\n * Pure HTML nav with Tailwind styling, using Button variants for link appearance. Part of the Saasflare base component layer.\n * @module packages/ui/components/ui/pagination\n * @layer core\n *\n * @component\n * @example\n * import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext } from '@saasflare/ui';\n * <Pagination>\n *   <PaginationContent>\n *     <PaginationItem><PaginationPrevious href=\"#\" /></PaginationItem>\n *     <PaginationItem><PaginationLink href=\"#\" isActive>1</PaginationLink></PaginationItem>\n *     <PaginationItem><PaginationLink href=\"#\">2</PaginationLink></PaginationItem>\n *     <PaginationItem><PaginationNext href=\"#\" /></PaginationItem>\n *   </PaginationContent>\n * </Pagination>\n */\nimport * as React from \"react\"\nimport {\n  CaretLeftIcon,\n  CaretRightIcon,\n  DotsThreeIcon,\n} from \"@saasflare/ui\"\n\nimport { cn } from \"@saasflare/ui\"\nimport {\n  useSaasflareProps,\n  type SaasflareComponentProps,\n} from \"@saasflare/ui\"\nimport { buttonVariants } from \"@saasflare/ui\"\n\ninterface PaginationProps\n  extends Omit<React.ComponentProps<\"nav\">, keyof SaasflareComponentProps>,\n    SaasflareComponentProps {}\n\n/**\n * Pagination root — semantic `<nav>` landmark wrapping the page controls.\n *\n * Carries the theme axes (`surface`/`radius`/`animated`) so descendant links\n * can inherit the active design-system context.\n */\nfunction Pagination({\n  className,\n  surface,\n  radius,\n  animated,\n  iconWeight,\n  ...props\n}: PaginationProps) {\n  const sf = useSaasflareProps({ surface, radius, animated, iconWeight })\n  return (\n    <nav\n      role=\"navigation\"\n      aria-label=\"pagination\"\n      data-slot=\"pagination\"\n      data-surface={sf.surface}\n      data-radius={sf.radius}\n      data-animated={String(sf.animated)}\n      className={cn(\"mx-auto flex w-full justify-center\", className)}\n      {...props}\n    />\n  )\n}\n\n/** Horizontal `<ul>` list that holds the {@link PaginationItem} entries. */\nfunction PaginationContent({\n  className,\n  ...props\n}: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"pagination-content\"\n      className={cn(\"flex flex-row items-center gap-1\", className)}\n      {...props}\n    />\n  )\n}\n\n/** Single `<li>` slot wrapping a {@link PaginationLink} or control. */\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n  return <li data-slot=\"pagination-item\" {...props} />\n}\n\ninterface PaginationLinkProps\n  extends Omit<React.ComponentProps<\"a\">, keyof SaasflareComponentProps>,\n    SaasflareComponentProps {\n  /** Marks the link as the current page (renders the `outline` button variant + `aria-current`). */\n  isActive?: boolean\n  /** Button-variant size token controlling the link's footprint. Defaults to the icon-only `\"icon\"`. */\n  size?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"icon\" | \"icon-xs\" | \"icon-sm\" | \"icon-lg\"\n}\n\n/**\n * Anchor styled as a button via {@link buttonVariants}. Active state switches\n * to the `outline` variant; inactive uses `ghost`. Carries the theme axes so\n * its radius/surface follow the design-system context like {@link Button}.\n */\nfunction PaginationLink({\n  className,\n  isActive,\n  size = \"icon\",\n  surface,\n  radius,\n  animated,\n  iconWeight,\n  ...props\n}: PaginationLinkProps) {\n  const sf = useSaasflareProps({ surface, radius, animated, iconWeight })\n  return (\n    <a\n      aria-current={isActive ? \"page\" : undefined}\n      data-slot=\"pagination-link\"\n      data-active={isActive}\n      data-surface={sf.surface}\n      data-radius={sf.radius}\n      data-animated={String(sf.animated)}\n      className={cn(\n        buttonVariants({\n          variant: isActive ? \"outline\" : \"ghost\",\n          size,\n        }),\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/** \"Previous page\" control — a labelled {@link PaginationLink} with a left caret. */\nfunction PaginationPrevious({\n  className,\n  ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n  const sf = useSaasflareProps()\n  return (\n    <PaginationLink\n      aria-label=\"Go to previous page\"\n      size=\"md\"\n      className={cn(\"gap-1 px-2.5 sm:pl-2.5\", className)}\n      {...props}\n    >\n      <CaretLeftIcon weight={sf.iconWeight} />\n      <span className=\"hidden sm:block\">Previous</span>\n    </PaginationLink>\n  )\n}\n\n/** \"Next page\" control — a labelled {@link PaginationLink} with a right caret. */\nfunction PaginationNext({\n  className,\n  ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n  const sf = useSaasflareProps()\n  return (\n    <PaginationLink\n      aria-label=\"Go to next page\"\n      size=\"md\"\n      className={cn(\"gap-1 px-2.5 sm:pr-2.5\", className)}\n      {...props}\n    >\n      <span className=\"hidden sm:block\">Next</span>\n      <CaretRightIcon weight={sf.iconWeight} />\n    </PaginationLink>\n  )\n}\n\n/** Non-interactive ellipsis indicating a gap (skipped pages) in the sequence. */\nfunction PaginationEllipsis({\n  className,\n  ...props\n}: React.ComponentProps<\"span\">) {\n  const sf = useSaasflareProps()\n  return (\n    <span\n      aria-hidden\n      data-slot=\"pagination-ellipsis\"\n      className={cn(\"flex size-9 items-center justify-center\", className)}\n      {...props}\n    >\n      <DotsThreeIcon weight={sf.iconWeight} className=\"size-4\" />\n      <span className=\"sr-only\">More pages</span>\n    </span>\n  )\n}\n\nexport {\n  Pagination,\n  PaginationContent,\n  PaginationLink,\n  PaginationItem,\n  PaginationPrevious,\n  PaginationNext,\n  PaginationEllipsis,\n}\n",
      "target": "components/ui/pagination.tsx"
    }
  ],
  "$meta": {
    "source": "https://ui.saasflare.io/r/pagination.json"
  }
}
