Configuration

Sparke is zero-config. Every dial here is optional – there's no JS API and no global object.

Sparke is zero-config: everything here is optional, and there is no JavaScript API and no global object. The only extension point is events.

Naming. Dials on Sparke's own <script> tag are bare. Attributes Sparke reads or writes on your elements are namespaced data-sparke-*.

Script-tag config

Read once at load, on the Sparke <script> tag.

Attribute Default Meaning
data-transitions off Opt into View Transitions.
data-loading-delay 150 Ms in flight before the loading state shows. 0 = immediate.
data-ignore "" Space-separated path patterns to exclude (trailing * = wildcard).

Attributes on your elements

Attribute On Meaning
data-sparke-active <a> Active-link section highlighting (patterns; match gets aria-current="page").
data-sparke-rerun <script> Re-run this script on each swap. ="once" = first visit only.

State Sparke sets, and the header it sends

Hook Meaning
<html data-sparke-loading> Present while a navigation is in flight past the delay.
a[aria-current="page"] The link to the current route (and data-sparke-active matches).
X-Sparke: preload | navigate Request header on every fetch – preload = idle prefetch, navigate = click/submit.