pagination
draco-china-github/paginationFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/pagination.jsonSource
1import * as React from "react"23import { cn } from "@/registry/radix-sera/lib/utils"4import { Button } from "@/registry/radix-sera/ui/button"5import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"67function Pagination({ className, ...props }: React.ComponentProps<"nav">) {8 return (9 <nav10 role="navigation"11 aria-label="pagination"12 data-slot="pagination"13 className={cn("mx-auto flex w-full justify-center", className)}14 {...props}15 />16 )17}1819function PaginationContent({20 className,21 ...props22}: React.ComponentProps<"ul">) {23 return (24 <ul25 data-slot="pagination-content"26 className={cn("flex items-center gap-1", className)}27 {...props}28 />29 )30}3132function PaginationItem({ ...props }: React.ComponentProps<"li">) {33 return <li data-slot="pagination-item" {...props} />34}3536type PaginationLinkProps = {37 isActive?: boolean38} & Pick<React.ComponentProps<typeof Button>, "size"> &39 React.ComponentProps<"a">4041function PaginationLink({42 className,43 isActive,44 size = "icon",45 ...props46}: PaginationLinkProps) {47 return (48 <Button49 asChild50 variant={isActive ? "outline" : "ghost"}51 size={size}52 className={cn(className)}53 >54 <a55 aria-current={isActive ? "page" : undefined}56 data-slot="pagination-link"57 data-active={isActive}58 {...props}59 />60 </Button>61 )62}6364function PaginationPrevious({65 className,66 text = "Previous",67 ...props68}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {69 return (70 <PaginationLink71 aria-label="Go to previous page"72 size="default"73 className={cn("pl-2!", className)}74 {...props}75 >76 <IconPlaceholder77 lucide="ChevronLeftIcon"78 tabler="IconChevronLeft"79 hugeicons="ArrowLeft01Icon"80 phosphor="CaretLeftIcon"81 remixicon="RiArrowLeftSLine"82 data-icon="inline-start"83 className="cn-rtl-flip"84 />85 <span className="hidden sm:block">{text}</span>86 </PaginationLink>87 )88}8990function PaginationNext({91 className,92 text = "Next",93 ...props94}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {95 return (96 <PaginationLink97 aria-label="Go to next page"98 size="default"99 className={cn("pr-2!", className)}100 {...props}101 >102 <span className="hidden sm:block">{text}</span>103 <IconPlaceholder104 lucide="ChevronRightIcon"105// … truncated
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 201 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | no deps | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | no deps | |
| avataravatar | shadcn/ui | Components | Free | no deps | |
| badgebadge | shadcn/ui | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | no deps | |
| buttonbutton | shadcn/ui | Components | Free | no deps |
