datastar

Patch DOM elements and signals via datastar attributes with SSE streaming.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill datastar-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: datastar
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/datastar
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill datastar-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Datastar enables backend-driven UI development by letting server-side logic drive DOM updates and UI state through signals and SSE, reducing heavy frontend code.

Core Features & Use Cases

  • Server-driven rendering with DOM patching and SSE streaming
  • Reactive signals and two-way binding for lightweight frontends
  • Real-time collaboration patterns and scalable UI morphing suitable for dashboards and admin interfaces

Quick Start

Load the Datastar demo and observe how the backend patches HTML in response to actions.

Frequently Asked Questions about datastar

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build real-time dashboards with backend-driven UI updates?

Backend-driven UI updates enable real-time dashboards by streaming SSE events from the server. The backend patches DOM elements and updates reactive signals directly, eliminating the need for heavy frontend JavaScript frameworks.

What is DOM morphing and how does it work for server-side rendering?

DOM morphing is a server-side rendering technique where the backend transmits HTML patches via SSE. It applies structured backend control to update specific page elements reactively without reloading the entire document or relying on client-side diffing.

Can I use reactive signals for two-way binding without a frontend framework?

Reactive signals enable two-way binding for lightweight frontends without a heavy framework. They maintain UI state and automatically update the DOM when the backend pushes new data through SSE streams.

Does SSE work well for real-time collaboration UIs and admin interfaces?

SSE effectively supports real-time collaboration UIs and admin interfaces by maintaining persistent server connections. It enables scalable UI morphing and server-driven rendering where the backend continuously patches elements and signals.

What is the best way to patch DOM elements from the backend?

The best way to patch DOM elements from the backend is using datastar attributes combined with SSE. This approach applies structured backend control to stream HTML patches and update reactive signals for lightweight frontend applications.

Why use backend-driven UI over traditional client-side state management?

Backend-driven UI reduces heavy frontend code by shifting state management to the server. It leverages SSE and reactive signals to patch the DOM, simplifying complex real-time workflows like collaboration UIs and dashboards.