Grid loader
Column scan
A bright band travels down each column, then moves to the next. A single React component with its CSS built in and no dependencies. Install it with the shadcn CLI or copy the source.
Preview and installation
Run this command in any project set up with shadcn.
npx shadcn@latest add https://loadercn.vercel.app/r/grid-column-scan.jsonAdded the @loadercn registry? Use the short form:
npx shadcn@latest add @loadercn/grid-column-scanThen add it to your interface:
import { GridColumnScan } from "@/components/ui/grid-column-scan"
<GridColumnScan size={48} speed={1.6} />Inherits text color. Accepts className, style, and a custom loading label. Respects reduced-motion preferences.
import type { CSSProperties, ComponentProps } from "react"
export type GridColumnScanProps = ComponentProps<"span"> & {
size?: number
/** Duration of one complete cycle, in seconds. */
speed?: number
label?: string
}
export function GridColumnScan({
size = 40,
speed = 1.6,
label = "Loading",
className,
style,
...props
}: GridColumnScanProps) {
return (
<span
role="status"
aria-label={label}
{...props}
className={["grid-column-scan-loader", className]
.filter(Boolean)
.join(" ")}
style={
{
width: size,
height: size,
"--loader-duration": `${Math.max(0.1, speed)}s`,
...style,
} as CSSProperties
}
>
<span aria-hidden="true" className="grid-column-scan-loader-grid">
{Array.from({ length: 16 }, (_, i) => (
<span
key={i}
style={{
animationDelay: `${(((i % 4) * 4 + Math.floor(i / 4)) / 16 - 1) * Math.max(0.1, speed)}s`,
}}
/>
))}
</span>
<style>{`
.grid-column-scan-loader { display: inline-flex; flex-shrink: 0; }
.grid-column-scan-loader-grid { display: grid; width: 100%; height: 100%; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 8%; }
.grid-column-scan-loader-grid > span { background: currentColor; border-radius: 0; opacity: .16; animation: grid-column-scan-loader-light var(--loader-duration) linear infinite; }
@keyframes grid-column-scan-loader-light { 0%, 100% { opacity: 1; } 12.5% { opacity: .85; } 37.5%, 93.75% { opacity: .16; } }
@media (prefers-reduced-motion: reduce) { .grid-column-scan-loader-grid > span { animation: none; opacity: .65; } }
`}</style>
</span>
)
}
Copy the complete file into your components directory. Styles are included.
When to use it
Suits column-oriented work like importing spreadsheets, parsing tables, or processing records one field at a time.
Props
Column scan accepts size, speed, label, className, and style, like every loader in the collection. See the installation guide for the full reference.