API reference
data-* attributes
A body is configured entirely in markup. Each force reads only the attributes it uses and ignores the rest, so you can set a few and compose freely.
All attributes
-
data-bodyfrozen · attribute contract tokens - Space-separated force ids — required to make an element a body. Forces compose.
-
data-strengthnumber · default 0.5 - Force magnitude S.
-
data-rangepx · default 280 - Influence radius d_max.
-
data-spinnumber · default 1 - Sign/strength of rotation — swirl, charge, magnetism, lens.
-
data-angledeg · default 0 - Heading — stream, jet, gate, shear, align.
-
data-colorhex - Accent override on engage, and the carried color for pigment.
-
data-whencondition · default '' - Gate the force on a condition: active, fast, slow, hot, cool, scrolling.
-
data-feedbackflag - Opt into two-way density write-back (the --d custom property).
-
data-shapedflag - Shaped source — forces reference the nearest point on the element box, so matter shells the shape instead of bunching at its centre.
-
data-affectsspecies - Matter tagging — a comma-separated species set this body acts on (e.g. "1" or "1,2"). Matter whose species is outside the set is skipped entirely (no force, no density sample). Omit to act on all matter (the default). Lets pollen / seeds / spores share one field, each pulled only by its own bodies.
-
data-speciesnumber - The species tag a spawn source stamps on the matter it emits, so a downstream data-affects body can act on it selectively. Particles default to species 0.
-
data-absorbpx · default 64 - Capture radius for the sink force.
-
data-maxnumber · default 60 - Load at which a sink supernovas (releases).
-
data-lifeframes · default 90 (spawn) - Source budget: how long each particle a spawn source emits lives. An unbudgeted source gets the safe default 300 (and a dev warning).
-
data-capnumber - Source budget: the most live particles a spawn source sustains — the emission rate is clamped to cap/life. The unbudgeted-source safe default is 120.
-
data-screen-minnumber · default 0 - Floor of the screen modifier’s attenuation factor (0 = other forces may cancel fully at the screen’s core).
-
data-fmin / data-fmaxnumber - Variable-font weight range that --d drives on a feedback body.
-
data-opsznumber - Optical-size axis to drive alongside weight.
-
data-active"1" - Engagement state — set automatically on hover/focus of a [data-hot] element.
-
data-presetname - Expand a preset into several co-located bodies — blackhole, galaxy, tornado, …
Which force reads which
Beyond the universal data-body / data-when / data-feedback,
each force reads this subset (declared in the catalog):
-
attract -
repel -
swirl -
stream -
viscosity -
jet -
tether -
wall -
sink
-
gravity -
charge -
magnetism -
thermal -
collide -
diffuse -
propagate -
memory
-
lens -
gate -
buoyancy -
shear -
crystallize -
align -
wind -
cohesion -
pressure -
hunt -
spawn -
link -
morph -
resonate -
spotlight -
screen -
pigment -
fieldflow -
warp
What the field writes back
Reciprocity has two halves: bodies bend the field through data-*, and the field
bends them back through CSS custom properties. A body that opts in (data-feedback)
receives these on its element — read them in your own CSS to make type glow, cards lift, or a
meter fill. The write target is the element itself, or a body's writeTarget.
--d on data-feedback The body's own gathered density ∈ [0,1], eased. The canonical reaction var.
--field-density on data-feedback Namespaced alias of --d (same value).
--field-heatmap-density on data-feedback + heatmap The ambient heatmap density under the body ∈ [0,1] — where matter pools around it, distinct from --d.
--load / --mass on sink body A sink’s accretion fill fraction ∈ [0,1] (--mass is a back-compat alias).
--lit on causality Spillover-lit density when a saturated neighbour bleeds density across a boundary.
--entropy on data-feedback Measured local disorder ∈ [0,1] — velocity-direction dispersion, gated by agitation (physics workover v0.3). Engine-measured; distinct from the platform’s inferred --field-entropy lane.
--coherence on data-feedback Measured local order ∈ [0,1] (= 1 − entropy; velocity alignment). Numeric — not the --coherence palette color on :root.
--temperature on data-feedback Measured local agitation ∈ [0,1] — half mean heat, half normalized kinetic energy.