shadcn.io is not affiliated with official shadcn/ui
Fuzzy Text shakes a line like a weak analogue signal: its rows of pixels jitter sideways, a new pattern every few frames, so the letters shimmer with static. It fuzzes harder while the pointer is over it, or, the other way round, comes into focus.
Use it for an atmospheric headline, a retro or horror theme, or a label that should resolve when someone reaches for it. For noise that settles into the text once, use Decrypted Text; for tears in bursts, Glitch Text. The text stays real text: an SVG filter of noise displaces it, four seeds of noise stepped through by a CSS keyframe animation the install adds to your stylesheet, at about twelve frames a second, with no canvas and no frame loop. With reduced motion the fuzz holds still.
Installation
Usage
import { FuzzyText } from "@/components/ui/fuzzy-text";<h1>
<FuzzyText text="No signal" />
</h1>Demos
Focus
hoverIntensity is how it fuzzes under the pointer, strong by default; none turns it around, so a strongly fuzzed label comes into focus when the pointer reaches it.
Intensity
intensity is how far the rows shake at rest: subtle, medium (the default) or strong; none leaves the text clear until it's hovered.
Accessibility
The text is real text, read once by screen readers and selectable; the filter only changes how it's drawn. The fuzz never flashes: it shakes the letters' edges without changing their brightness. With reduced motion it holds still, and in forced-colors mode the filter is dropped. Keep strong for short, large text: it costs legibility.
FAQ
How is the fuzz made?
An SVG filter in the component: horizontal bands of noise (feTurbulence) push each row of the text's pixels sideways (feDisplacementMap). Four filters with different seeds are stepped through by a CSS animation, so the static changes about twelve times a second.
Does it work in every browser?
SVG filters on HTML text work in current Chrome, Edge, Firefox and Safari. Safari may draw the filtered text a touch softer; check your headline there if it's small.
Can I use several on one page?
Yes. Each one names its filters with an id of its own, so instances never share or override each other's filters.
Does the fuzz scale with the text?
No: it shakes the rows by a number of pixels, the same at any size, so it reads stronger on small text. Use subtle on smaller text and save strong for headlines.
API Reference
FuzzyText
<span> data-slot="fuzzy-text"
textstring
The text.
hoverIntensity?Intensity
How hard it fuzzes while the pointer is over it; none brings it into
focus.
- Default
"strong"
intensity?Intensity
How hard it fuzzes: how far its rows of pixels shake sideways. @default "medium".
- Default
"medium"
render?ReactElement | ((props: object, state: object) => ReactElement)
Replace the host element or compose it with another component.
- Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string
Merged with the part's classes.
--fuzzy-text-0string
The first frame's filter (--fuzzy-text-1 to -3 the others; -hover- while hovered).
--fuzzy-text-hover-0stringRelated
- Pro
Decrypted Text
DecodeNoise that settles into the text once
- Pro
Glitch Text
DecorativeTears that come in bursts
- Pro
Chromatic Text
DecorativeRed and cyan fringes, no static
- Pro
Flickering Text
DecorativeA failing sign that dips and blinks
- Pro
True Focus
InteractiveOne word sharp, the rest soft
- Pro
Liquid Text
InteractiveLetters that sway and melt together