Pagination
octane/paginationFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/pagination.jsonSource
1// Base UI base pagination — TRANSCRIBED from upstream's `bases/base-ui/ui/pagination.tsx`2// (maintainer-supplied), class strings verbatim. There is no pagination primitive in any base;3// the family is host elements plus button styling, and the only base-specific question is how the4// link acquires that styling.5//6// THE LINK GOES THROUGH `Button`, NOT THROUGH `buttonVariants`. The radix base writes7// `<Button asChild><a/></Button>`, where Slot is a pure prop-merger that layers no button8// semantics onto the anchor. Base UI has no Slot, so upstream uses the `render` prop plus9// `nativeButton={false}` — the documented escape for "this Button is not a native `<button>`".10//11// THE TWO BASES THEREFORE DIVERGE OBSERVABLY, and that is upstream's call, not a porting bug:12// this base's links carry `role="button"` and `tabindex="0"` (verified by rendering) where the13// radix base's carry neither. `nativeButton={false}` is what keeps keyboard activation working on14// a non-button element, which is the trade upstream chose. Do not "fix" this toward radix by15// dropping Button for a bare `buttonVariants()` anchor: it diverges from the source, and it also16// drops the key handling Base UI attaches.17//18// Octane adaptations: lucide-react → @octanejs/lucide, and children are passed explicitly rather19// than riding along in the props spread — React's `ComponentProps<"a">` carries `children`, octane20// routes it through its own channel.21import { createElement, type OctaneNode } from 'octane';22import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from '@octanejs/lucide';2324import { cn } from '@/lib/utils';25import { Button, type ButtonProps } from '@/components/ui/button';2627type Props = { className?: string } & Record<string, unknown>;2829export function Pagination({ className, ...props }: Props) @{30 <nav31 role="navigation"32 aria-label="pagination"33 data-slot="pagination"34 className={cn('mx-auto flex w-full justify-center', className)}35 {...props}36 />37}3839export function PaginationContent({ className, ...props }: Props) @{40 <ul41 data-slot="pagination-content"42 className={cn('flex items-center gap-0.5', className)}43 {...props}44 />45}4647export function PaginationItem(props: Record<string, unknown>) @{48 <li data-slot="pagination-item" {...props} />49}5051export interface PaginationLinkProps extends Record<string, unknown> {52 className?: string;53 isActive?: boolean;54 size?: ButtonProps['size'];55 children?: OctaneNode;56}5758// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | octane | Components | Free | no deps | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps |
