- Changelog entry 14
- Changelog entry 13
- Changelog entry 12
- Changelog entry 11
Installation
$ pnpm dlx shadcn@latest add @synccn/load-moreFirst time in this project? Connect synccn with one command.
Usage
import { LoadMore } from "@/components/ui/nav-extras";<LoadMore onLoad={fetchNext} hasMore={hasMore} />API reference
Generated from the component's TypeScript types, so it always matches the code.
LoadMore
"Load more" button for long lists, with a loading state and an end-of-list message.
PropTypeDescription
- onLoad
() => void | Promise<void>Loads the next page. Return a promise to show the loading state.
- hasMore
booleanDefault
trueFalse shows the end-of-list message.
- loadingLabel
stringDefault
"Loading…"Button text while loading.
- doneLabel
stringDefault
"You've reached the end"Message when there's nothing left.
- children
React.ReactNodeDefault
"Load more"Content to render.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for ArrowUp, Plus
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-current, aria-expanded, aria-hidden, aria-label
- Closes with Escape
- Closes when you click or tap outside
More navigation
BreadcrumbPath to the current page, with chevrons or slashes.PaginationPage numbers with ellipses for long ranges.StepperProgress through a multi-step flow.DockApp dock that magnifies icons near the pointer.Navigation MenuSite navigation with mega-menu panels.SidebarCollapsible app sidebar with groups, badges and nested items.