Fluid Particle Text
Interactive particle typography sampled from rasterized text. A dense sheet of material at rest, advected along your cursor trajectory with pressure, shear and topology coherence, then sprung home.
Installation#
pnpm dlx shadcn@latest add @davinciui/fluid-particle-textUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
textSource text rasterized into particle home positions. Supports \n line breaks. | string | — |
fontFamilyFont used for rasterization. The component waits for it via document.fonts before sampling. | string | "Arial Black", ... |
fontWeightWeight used for rasterization. | number | string | 900 |
fontSizeBase size in CSS px. Used directly when fitMode is off. | number | 160 |
fitModeFit scales text inside bounds, fill aggressively covers them, off uses fontSize directly. | "off" | "fit" | "fill" | "fit" |
colorParticle color. | string | "#000000" |
backgroundCanvas background. | string | "#ffffff" |
particleSizeParticle diameter in CSS px (scaled by DPR in the shader). | number | 2 |
presetNamed tuning preset. showcase powers the INK demo; explicit props always win. | "default" | "showcase" | "reference404" | — |
particleSpacingParticle spacing in CSS px (≈1.25 in the reference). Overrides sampleQuality when set. | number | 2 |
particleShapeSquare tiles into a near-solid glyph; circle renders soft dots. | "circle" | "square" | "square" |
sampleQualitySampling density. Gap auto-escalates to respect maxParticles. | "low" | "medium" | "high" | "ultra" | "high" |
interactionRadiusCursor influence radius in CSS px. Defines a smooth field, not a visible edge. | number | 110 |
viscosityLocal velocity coherence near the interaction so rows flow together instead of spokes. | number | 3 |
forceStrengthLegacy pressure scaler. Prefer pressureStrength for new work. | number | 1 |
advectionStrengthDominant force: how strongly particles inherit cursor velocity along the path. | number | 1 |
pressureStrengthBroad, soft separation normal to the pointer path. | number | 0.12 |
corePressureStrengthNarrow path-normal pressure for visible cuts without a circular radius target. | number | 0 |
shearStrengthDirectional shear across the path; produces tapered sheets and filaments. | number | 0.2 |
topologyCohesionRaster-neighbor velocity coherence so deformed rows stay readable. | number | 0.1 |
homeStrengthHome spring in 1/s^2. Direct alternative to returnSpeed. | number | 16 |
trailLifetimePointer-path memory in seconds. Stretched cuts need longer memory. | number | 0.3 |
curlStrengthTangential swirl around the cursor. | number | 0.25 |
returnSpeedHome spring stiffness. | number | 0.08 |
dampingVelocity retention per frame. Lower settles faster. | number | 0.9 |
maxDisplacementMaximum excursion from home in CSS px. | number | 150 |
maxParticlesHard particle budget cap. | number | 220000 |
maxDprCaps devicePixelRatio for the render target. | number | 2 |
Accessibility#
The container exposes role=img with aria-label defaulting to the text, while the canvas is aria-hidden. Pointer movement drives the effect and touch is ignored; there is no focusable control or keyboard alternative, so the deformation is purely decorative.
Motion#
Particles advect along the cursor path and spring home, tuned by pointerFollow, advectionStrength, pressureStrength, shearStrength, homeStrength, trailLifetime and trailLength. prefers-reduced-motion is detected via matchMedia; when it matches, the canvas shows the resting glyph and the simulation loop does not run.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

