Pagination.
A smaller window into a larger collection.
Live preview
import { Pagination } from "luminescent";
import "luminescent/style.css";
export function Example() {
return <Pagination count={12} defaultPage={1} aria-label="Project pages" />;
}
Installation
npm install luminescent
Import luminescent/style.css once at your application root. The example above uses the same package implementation as Storybook.
Variants and states
Use the preview controls to explore the supported variants, sizes, disabled/loading states and reduced motion. Controls appear only where the component exposes the corresponding prop. Theme and glow apply to every component.
Controlled and uncontrolled state
State contract: page / defaultPage / onPageChange. Omit the controlled prop to let the component own its initial state; supply a value and callback when your application owns it. Native uncontrolled fields and state-backed form controls participate in form reset. Controlled state must be reset by the application.
import { useState } from "react";
import { Pagination } from "luminescent";
export function ControlledExample() {
const [value, setValue] = useState(1);
return <Pagination count={12} page={value} onPageChange={setValue} />;
}
API reference
Generated from the source TypeScript interfaces. Native attributes, className, style, aria-* and data-* also pass through to the documented element. Import PaginationProps from the package for the full inherited contract.
| Prop | Type | Details |
|---|---|---|
countrequired | number | Optional unless marked required. |
page | number | Optional unless marked required. |
defaultPage | number | Optional unless marked required. |
onPageChange | (page: number) => void | Optional unless marked required. |
disabled | boolean | Optional unless marked required. |
siblingCount | number | Optional unless marked required. |
Accessibility and keyboard
Named navigation with native buttons and current-page state. Previous/next disable at boundaries. Zero pages render nothing. Large counts render a bounded set; update result announcements/focus in the consuming application.
Keep labels meaningful and test application-level contrast, focus order and screen-reader output. See the accessibility guide for composition requirements.
Theme customization
import { LuminescentProvider, Pagination } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<LuminescentProvider theme="light" accent="violet" glow="subtle">
<Pagination count={12} defaultPage={1} aria-label="Project pages" />
</LuminescentProvider>
);
}
Switch between light and dark in the preview, or open the playground for a larger workspace. Custom CSS variables can override spacing, color, typography and effects.