Pagination
muffled-ui-registry/paginationFreeComponent
Page navigation with previous, next, numbered links, and ellipsis.
Live preview
live · rendered by the registry
Rendered by muffled-ui-registry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.muffled.studio/r/pagination.jsonSource
1import * as React from "react"2import { type VariantProps } from "class-variance-authority"3import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"45import { cn } from "@/registry/lib/surface"6import { buttonVariants } from "@/registry/ui/button"78function Pagination({ className, ...props }: React.ComponentProps<"nav">) {9 return (10 <nav11 role="navigation"12 aria-label="pagination"13 data-slot="pagination"14 className={cn("mx-auto flex w-full justify-center", className)}15 {...props}16 />17 )18}1920function PaginationContent({21 className,22 ...props23}: React.ComponentProps<"ul">) {24 return (25 <ul26 data-slot="pagination-content"27 className={cn("flex items-center gap-0.5", className)}28 {...props}29 />30 )31}3233function PaginationItem({ ...props }: React.ComponentProps<"li">) {34 return <li data-slot="pagination-item" {...props} />35}3637type PaginationLinkProps = {38 isActive?: boolean39} & Pick<VariantProps<typeof buttonVariants>, "size"> &40 React.ComponentProps<"a">4142function PaginationLink({43 className,44 isActive,45 size = "icon",46 ...props47}: PaginationLinkProps) {48 return (49 <a50 aria-current={isActive ? "page" : undefined}51 data-slot="pagination-link"52 data-active={isActive}53 className={cn(54 buttonVariants({55 variant: isActive ? "outline" : "ghost",56 size,57 }),58 className59 )}60 {...props}61 />62 )63}6465function PaginationPrevious({66 className,67 text = "Previous",68 ...props69}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {70 return (71 <PaginationLink72 aria-label="Go to previous page"73 size="default"74 className={cn("pl-1.5!", className)}75 {...props}76 >77 <ChevronLeftIcon data-icon="inline-start" />78 <span className="hidden sm:block">{text}</span>79 </PaginationLink>80 )81}8283function PaginationNext({84 className,85 text = "Next",86 ...props87}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {88 return (89 <PaginationLink90 aria-label="Go to next page"91 size="default"92 className={cn("pr-1.5!", className)}93 {...props}94 >95 <span className="hidden sm:block">{text}</span>96 <ChevronRightIcon data-icon="inline-end" />97 </PaginationLink>98 )99}100101function PaginationEllipsis({102 className,103 ...props104}: React.ComponentProps<"span">) {105 return (106 <span107 aria-hidden108 data-slot="pagination-ellipsis"109// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from muffled-ui-registry
All 55 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | muffled-ui-registry | Components | Free | 2 deps | |
| Alertalert | muffled-ui-registry | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | muffled-ui-registry | Components | Free | 1 dep | |
| Avataravatar | muffled-ui-registry | Components | Free | 1 dep | |
| Badgebadge | muffled-ui-registry | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | muffled-ui-registry | Components | Free | 2 deps | |
| Buttonbutton | muffled-ui-registry | Components | Free | 2 deps | |
| Button Groupbutton-group | muffled-ui-registry | Components | Free | 2 deps |
