Pixel Loader
ProNewA pixel-grid loader with four patterns, a shimmering label and a running clock.
Installation
pnpm dlx shadcn@latest add @viewport/pixel-loader
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| variant | VariantThe pattern the pixels light up in. | "wave" |
| label | stringStatus text next to the grid. Also what screen readers announce. | "Thinking" |
| showElapsed | booleanCount the seconds since the loader appeared. | true |
| grid | numberPixels per side of the grid. | 3 |
| size | numberSize of one pixel, in CSS pixels. | 4 |
| duration | numberSeconds for one pass of the pattern. | 1.2 |
| className | string | — |
Accessibility
- A status region that announces the label once, never the clock.
- The pattern is CSS and freezes mid-pass under reduced motion.
- Uses tabular numerals so the clock never shifts the layout.