Loader
Line Loader
NewOne thin line fills across the screen, then the screen fades out.
npx motionsnack add line-loaderCustomize
<LineLoader />Props
10 properties
| Property | Type | Default | Description |
|---|---|---|---|
| background | string | zinc-100 / zinc-900 in dark | Colour of the loader's panels / backdrop. |
| color | string | zinc-950 / white in dark | Colour of text, numbers and lines drawn on it. |
| contained | boolean | false | Fill the nearest positioned parent instead of the whole window. |
| loopDelayMs | number | 1200 | Pause before a looped loader starts again, in ms. |
| onPhase | (phase: 'in' | 'out' | 'done', revealAfterMs?: number) => void | - | Called on every phase change. With 'out' it also says after how many ms the page under the loader is visible enough to start its own animation. |
| className | string | '' | Extra classes on the loader. |
| fillMs | number | 1800 | How long the line takes to fill, in ms. |
| fadeMs | number | 600 | How long the backdrop takes to fade away, in ms. |
| minDurationMs | number | 0 | Minimum time on screen before it starts leaving, in ms. The loader never leaves before the line is full. |
| loop | boolean | false | Start over a moment after it finishes. For demos; a real page shows it once. |
About Line Loader
The quietest intro: a single thin line in the middle of the screen fills from left to right and the screen fades away to the page. It covers the whole window by default or just its parent with the contained prop, reports its phases through onPhase so the page can start its own animation at the right moment, and is skipped for visitors who prefer reduced motion. Colours follow the light and dark look or come from props.
What's included
- One thin progress line
- Fill and fade duration as props
- Announced to screen readers as a progress bar
- Whole window or contained in a parent
- Phase callback for the page under it
- Light and dark, skipped with reduced motion
- Type
- Animated React loader component
- Library
- Components · Loader
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-11-20
- Install
npx motionsnack add line-loader