Lifecycle events, morphing control, and debugging features
The section below is ignored by Datastar (no reactivity):
This content is ignored:
This button outside works normally:
Counter:Video below won't be disrupted during morphing:
Run initialization code when elements load into the DOM:
Auto-fetch user data on load:
Initialize component (with 300ms delay):
Send analytics when visible:
Common uses: API calls, component initialization, analytics tracking, lazy loading
All signals displayed as JSON:
Filtered signals (only those containing 'counter' or 'time'):
Apply attributes to multiple elements based on their data-slot:
Click the checkbox - data_bind is applied via slot_task_check:
Hover over items - slot attributes apply styling to ALL matching slots:
Notice: ALL icons, text, and counts change together when hovering ANY item
Toggle form validity to see multiple slot attributes in action:
Copy-paste syntax: Use slot_{name}=dict(...) with exact same attributes you'd use on elements directly!