Navigation
Load More Progress
"Load more" instead of pages: a progress bar and a "12 of 84" counter answer the one question a long list raises — how much is left.
- pagination
- load more
- progress
- list
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/pagination-005?lang=en
Показано 12 из 84
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
# Install and place "pagination-005" (Load More Progress) from VibeUI
## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/pagination-005.json
Registry item: https://vibeui.ru/r/pagination-005.json
Installs to: components/vibeui/pagination-005.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.
Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.
## 2. What it is
"Load more" instead of pages: a progress bar and a "12 of 84" counter answer the one question a long list raises — how much is left.
A "Load more" button with an honest scale: a progress bar, a counter of what is shown and a label saying how much the next press adds. At the end the button gives way to a line saying that is all. Zero dependencies, one file, its own palette.
## 3. How to use it
import { Pagination005 } from "@/components/vibeui/pagination-005"
<Pagination005 total={84} perPage={12} label="Load more" />
Read the installed file for the full prop list.
## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.
Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)
## 5. Keep exactly as installed
- the local --vibeui-pagination-005-* palette — do not swap it for your theme tokens (bg-primary, bg-muted and the like)
- the "shown of total" counter: without it a long list becomes an edgeless infinity
- role="progressbar" with aria-valuenow and the bounds: without roles the bar is just a coloured rectangle to a screen reader
- aria-live="polite" on the counter — otherwise the load goes unnoticed by anyone not watching the screen
- the number in the button caption: people have to know how much a press adds
- the explicit end-of-list line instead of a vanishing button: a disappeared button reads as a breakage
## 6. You may change
- total and perPage — the overall count and the batch size
- defaultShown — how much is shown at the start
- label — the button caption
- the accent through the accent prop — it colours the progress bar
## 7. Rules
- The component only shows the counters: the list itself and the data loading stay in the caller.
- The scroll position is untouched after loading — right for "load more", wrong for replacing a page.
- Such a list returns badly from a link: a place in it cannot be carried in a URL. If you need URLs, use pages.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.
## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.For developers
npx shadcn@latest add https://vibeui.ru/r/pagination-005.jsonhttps://vibeui.ru/r/pagination-005.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-pagination-005-*. Клиентский: "use client" ради счётчика показанного. Ширина заливки приходит переменной --vibeui-pagination-005-progress, посчитанной из отношения показанного к общему. Полоса помечена role="progressbar" с aria-valuenow, aria-valuemin и aria-valuemax, а сообщение о догрузке живёт в области aria-live="polite". Когда показано всё, кнопка заменяется строкой о конце списка.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
"use client"
import { useState } from "react"
import type { CSSProperties } from "react"
export type Pagination005Props = {
total?: number
perPage?: number
defaultShown?: number
label?: string
accent?: string
className?: string
style?: CSSProperties
}
// Идея компонента: вместо страниц — одна кнопка «показать ещё» с честной шкалой.
// Список растёт вниз, поэтому прочитанное не пропадает и место в нём не теряется,
// а полоса и подпись «12 из 84» отвечают на главный вопрос такого списка: сколько
// ещё осталось. Сообщение о догрузке уходит в aria-live, иначе оно пройдёт мимо.
const STYLES = `
:where([data-vibeui-block="pagination-005"]){
--vibeui-pagination-005-bg:oklch(1 0 0);
--vibeui-pagination-005-fg:oklch(0.24 0.014 265);
--vibeui-pagination-005-muted:oklch(0.55 0.014 265);
--vibeui-pagination-005-border:oklch(0.91 0.006 265);
--vibeui-pagination-005-track:oklch(0.94 0.004 265);
--vibeui-pagination-005-hover:oklch(0.55 0.02 265 / 8%);
--vibeui-pagination-005-accent:oklch(0.55 0.2 262);
--vibeui-pagination-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="pagination-005"]{
box-sizing:border-box;width:100%;max-width:26rem;padding:1rem;
display:flex;flex-direction:column;align-items:center;gap:0.625rem;
background:var(--vibeui-pagination-005-bg);color:var(--vibeui-pagination-005-fg);
border:1px solid var(--vibeui-pagination-005-border);border-radius:0.875rem;
font-family:var(--vibeui-pagination-005-font);
}
[data-vibeui-block="pagination-005"] [data-part="track"]{
width:100%;height:0.25rem;border-radius:999px;overflow:hidden;
background:var(--vibeui-pagination-005-track);
}
/* Ширина заливки приходит переменной: считать её в CSS не из чего. */
[data-vibeui-block="pagination-005"] [data-part="fill"]{
display:block;height:100%;border-radius:999px;
width:var(--vibeui-pagination-005-progress);
background:var(--vibeui-pagination-005-accent);
transition:width .28s cubic-bezier(.32,.72,0,1);
}
[data-vibeui-block="pagination-005"] [data-part="count"]{
margin:0;font-size:0.8125rem;color:var(--vibeui-pagination-005-muted);
font-variant-numeric:tabular-nums;
}
[data-vibeui-block="pagination-005"] [data-part="now"]{color:var(--vibeui-pagination-005-fg);font-weight:650}
[data-vibeui-block="pagination-005"] [data-part="more"]{
appearance:none;cursor:pointer;
min-width:11rem;height:2.375rem;padding:0 1.25rem;box-sizing:border-box;
display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;
border:1px solid var(--vibeui-pagination-005-border);border-radius:0.625rem;
background:none;color:inherit;font:inherit;font-size:0.875rem;font-weight:550;
transition:background-color .14s ease;
}
[data-vibeui-block="pagination-005"] [data-part="more"]:hover:not(:disabled){background:var(--vibeui-pagination-005-hover)}
[data-vibeui-block="pagination-005"] [data-part="more"]:focus-visible{outline:2px solid var(--vibeui-pagination-005-accent);outline-offset:2px}
[data-vibeui-block="pagination-005"] [data-part="more"]:disabled{color:var(--vibeui-pagination-005-muted);cursor:default}
[data-vibeui-block="pagination-005"] [data-part="chevron"]{
width:0.4375rem;height:0.4375rem;margin-top:-0.25rem;
border:1.5px solid currentColor;border-left:0;border-top:0;transform:rotate(45deg);
}
[data-vibeui-block="pagination-005"] [data-part="done"]{margin:0;font-size:0.8125rem;color:var(--vibeui-pagination-005-muted)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="pagination-005"] *{animation:none!important;transition:none!important}}
`
/**
* «Показать ещё» вместо страниц: шкала прогресса и счётчик показанного.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Pagination005({
total = 84,
perPage = 12,
defaultShown = 12,
label = "Показать ещё",
accent,
className,
style,
}: Pagination005Props) {
const [shown, setShown] = useState(Math.min(defaultShown, total))
const done = shown >= total
const palette = {
"--vibeui-pagination-005-progress": `${Math.round((shown / total) * 100)}%`,
...(accent ? { "--vibeui-pagination-005-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-pagination-005" precedence="medium">
{STYLES}
</style>
<div
data-vibeui-block="pagination-005"
className={className}
style={palette}
>
<span
data-part="track"
role="progressbar"
aria-valuenow={shown}
aria-valuemin={0}
aria-valuemax={total}
aria-label="Показано из общего числа"
>
<span data-part="fill" />
</span>
<p data-part="count" aria-live="polite">
Показано <span data-part="now">{shown}</span> из {total}
</p>
{done ? (
<p data-part="done">Это всё, что нашлось</p>
) : (
<button
type="button"
data-part="more"
onClick={() => setShown(Math.min(shown + perPage, total))}
>
{label} {Math.min(perPage, total - shown)}
<span data-part="chevron" aria-hidden="true" />
</button>
)}
</div>
</>
)
}