Componentnavigation
LoadMore
Button row "LOAD MORE" with progress mono counter; on click reveals hidden children with stagger.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add load-moreOr install the full npm package:
npm install bigbulluiUsage
import { LoadMore } from "@/components/ui/load-more"
<LoadMore
items={[<div key={1} className="p-2 bg-card">Item 1</div>, <div key={2} className="p-2 bg-card">Item 2</div>]}
onLoadMore={() => {}} />Source code
load-more.tsxZero dependencies (only React + utils). Copy and paste directly into your project:
"use client";
import * as React from "react";
import { cn } from "./lib/utils";
export type LoadMoreProps = {
items?: React.ReactNode[];
onLoadMore?: () => void;
};
export function LoadMore({ items, onLoadMore }: LoadMoreProps) {
const [expanded, setExpanded] = React.useState(false);
const handleClick = () => {
setExpanded(true);
onLoadMore?.();
};
const delayClass = (index: number) => `${index * 40}ms`;
return (
<div className="relative">
<button
onClick={handleClick}
className={cn(
"w-full py-3 px-4 text-left text-sm font-medium text-primary uppercase tracking-wider",
"hover:bg-primary/10 transition-colors",
"motion-reduce:transition-none",
"motion-reduce:animate-none",
)}
>
LOAD MORE
</button>
{expanded && (
<div
className={cn(
"mt-4 space-y-2",
"motion-reduce:animate-none",
"motion-reduce:transition-none",
)}
>
{items?.map((item, index) => (
<div
key={index}
className={cn(
"p-3 bg-muted rounded-md",
"animate-fade-in-up",
"motion-reduce:animate-none",
"motion-reduce:transition-none",
)}
style={{ animationDelay: delayClass(index) }}
>
{item}
</div>
))}
</div>
)}
</div>
);
}Props
| Prop | Type | Description |
|---|---|---|
| items | React.ReactNode[] | Children to reveal on load more click. |
| onLoadMore | () => void | Callback when button is clicked. |