pagination
neobrutalism/paginationFreeComponent
neobrutalism publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by neobrutalism on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://neobrutalism.com/r/pagination.jsonSource
1import * as React from "react"2import {3 ChevronLeftIcon,4 ChevronRightIcon,5 MoreHorizontalIcon,6} from "lucide-react"78import { cn } from "@/lib/utils"9import { Button } from "@/components/ui/button"1011function Pagination({ className, ...props }: React.ComponentProps<"nav">) {12 return (13 <nav14 role="navigation"15 aria-label="pagination"16 data-slot="pagination"17 className={cn("mx-auto flex w-full justify-center", className)}18 {...props}19 />20 )21}2223function PaginationContent({24 className,25 ...props26}: React.ComponentProps<"ul">) {27 return (28 <ul29 data-slot="pagination-content"30 className={cn("flex items-center gap-0.5", className)}31 {...props}32 />33 )34}3536function PaginationItem({ ...props }: React.ComponentProps<"li">) {37 return <li data-slot="pagination-item" {...props} />38}3940type PaginationLinkProps = {41 isActive?: boolean42} & Pick<React.ComponentProps<typeof Button>, "size"> &43 React.ComponentProps<"a">4445function PaginationLink({46 className,47 isActive,48 size = "icon",49 ...props50}: PaginationLinkProps) {51 return (52 <Button53 variant={isActive ? "default" : "ghost"}54 size={size}55 className={cn(className)}56 nativeButton={false}57 render={58 <a59 aria-current={isActive ? "page" : undefined}60 data-slot="pagination-link"61 data-active={isActive}62 {...props}63 />64 }65 />66 )67}6869function PaginationPrevious({70 className,71 text = "Previous",72 ...props73}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {74 return (75 <PaginationLink76 aria-label="Go to previous page"77 size="default"78 className={cn("pl-1.5!", className)}79 {...props}80 >81 <ChevronLeftIcon data-icon="inline-start" className="cn-rtl-flip" />82 <span className="hidden sm:block">{text}</span>83 </PaginationLink>84 )85}8687function PaginationNext({88 className,89 text = "Next",90 ...props91}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {92 return (93 <PaginationLink94 aria-label="Go to next page"95 size="default"96 className={cn("pr-1.5!", className)}97 {...props}98 >99 <span className="hidden sm:block">{text}</span>100 <ChevronRightIcon data-icon="inline-end" className="cn-rtl-flip" />101 </PaginationLink>102 )103}104105function PaginationEllipsis({106 className,107 ...props108}: React.ComponentProps<"span">) {109 return (110 <span111 aria-hidden112// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from neobrutalism
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalism | Components | Free | 2 deps | |
| alertalert | neobrutalism | Components | Free | 2 deps | |
| alert-dialogalert-dialog | neobrutalism | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | neobrutalism | Components | Free | 1 dep | |
| avataravatar | neobrutalism | Components | Free | 1 dep | |
| badgebadge | neobrutalism | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | neobrutalism | Components | Free | 2 deps | |
| buttonbutton | neobrutalism | Components | Free | 2 deps |
