StringTune/Docs

API Reference

Common Attributes

Reference for shared declarative attributes used across built-in modules.

Common Attributes

This page is for attributes that are shared by the core runtime or by multiple built-in modules.

Module-specific inputs such as string-parallax, string-radius, or string-input still belong on their own module pages.

Reading Model

The runtime reads both of these forms:

  • string-*
  • data-string-*

Examples:

HTML
<section string="progress"></section>
<section data-string="progress"></section>

For token lists, the runtime uses | as the separator.

Examples:

HTML
<div string="progress|parallax"></div>
<div string-copy-from="hero|sidebar-progress"></div>

Identity And Routing

AttributeTargetDefaultReal runtime effect
stringmanaged elementrequired for element modulesDeclares which element modules can connect to the element. The value is split by `
string-idmanaged elementauto-generated string-NGives the object a stable runtime ID. Object-scoped events use this ID.
string-copy-frommirror elementnoneLinks the element to one or more source objects. Mirror outputs are copied from those source IDs.
string-keymodules that expose named CSS outputglobal setting key, default --progressRoutes a module output into a custom CSS variable name. Most commonly used by StringProgress.

Important behavior:

  • string-id is written back to the DOM when the runtime auto-generates one.
  • string-copy-from is also split by |, so one mirror element can follow multiple source IDs.
  • Mirrors are separate elements. They do not become managed source objects by themselves.

Shared Geometry

These attributes come from StringModule and affect the shared object timeline used by modules such as StringProgress and StringParallax.

AttributeDefaultReal runtime effect
string-offset-top0%Moves the effective end of the object timeline.
string-offset-bottom0%Moves the effective start of the object timeline.
string-inview-top0%Shifts the in-view start boundary used for object:inview:<id> and -inview.
string-inview-bottom0%Shifts the in-view end boundary used for object:inview:<id> and -inview.
string-enter-eltopSelects the object edge used for timeline start.
string-enter-vpbottomSelects the viewport edge paired with string-enter-el.
string-exit-elbottomSelects the object edge used for timeline end.
string-exit-vptopSelects the viewport edge paired with string-exit-el.

These values are parsed once into numeric positions during object initialization and rebuilds. They do not directly write styles.

Shared Behavior Flags

AttributeDefaultReal runtime effect
string-self-disablefalsePrevents module style and variable writes on the source element. Mirrors can still receive mirrored output.
string-repeatfalseAllows -inview class removal when the object leaves its in-view window.
string-outside-containerfalseForces the object activation observer to use the window root instead of the current custom scroll container.
string-fixednot setMarks the element as fixed for object-manager mutation handling. This is an advanced runtime flag, not a normal animation setting.

Practical Notes

  • string-id matters whenever you consume object:* events.
  • string-copy-from matters only for modules that actually mirror output. StringProgress, StringLerp, StringGlide, StringAnchor, and cursor target variables are examples.
  • string-key does not invent new output by itself. It only renames module output that already exists.
  • string-fixed is easy to overuse. Most normal module elements should not need it.

Where To Go Next