Text shimmer
Text that shows work going on, such as "Thinking…". Light moves over the words at an even pace while it loads, and they settle once at their full colour when the work ends.
Examples
Sweep
The default. A soft band passes and the words fade towards the page under it, so it shows on text of any colour, on any surface, and keeps full colour everywhere else. A new label crossfades and starts a new pass.
Glow
The band lights muted words up to the foreground. It needs text lighter than the foreground, or a --text-shimmer-highlight of your own: on foreground text it has nothing to add.
Breathe
Nothing travels: the whole line fades a little and comes back, for many rows working at once. Muted text dips below 4.5:1 for part of each breath, and under reduced motion it holds still.
Loading
loading={false} settles the words once at their full colour from wherever the light was, and true starts it again where it stopped.
Installation
npx shadcn@latest add https://kinoui.com/r/text-shimmer.json- Files
lib/refs.tslib/reduce-motion.tslib/resize.tslib/swap.tsxcomponents/kino/text-shimmer.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Props
Data attributes
CSS variables
Accessibility
- It is text, read once where it sits. Put it in a
role="status"region that is on the page before the text changes, so a screen reader hears each new step and the result. - Only one copy of the words is read and selected; the copy that carries the light is hidden from screen readers and can’t be selected.
- At rest the words are drawn once, at their own colour.
sweepdims them only under its band, andglowonly brightens them. - Under reduced motion nothing travels:
sweepandglowbreathe in place andbreatheholds still. In forced colours the light is off and the text takes the system colour.