This plugin is in alpha and its API may change.
Datastar is a free plugin for Craft CMS that allows you to create real-time front-ends driven by Twig templates. It aims to replace the need for front-end frameworks such as React, Vue.js and Alpine.js + htmx, and instead lets you manage state and run logic all within your Twig templates.
With Datastar, you have the ability to define state and manipulate the DOM in real-time on the front-end, and modify parts of the DOM with templates rendered on the back-end. Use-cases:
- Live searching elements
- Loading more elements / Infinite scroll
- Paginating, ordering and filtering lists of elements
- Submitting forms and running actions
- Pretty much anything to do with reactive front-ends
Datastar is lightweight, performant and opinionated about embracing hypermedia and removing front-end complexity. It can be used for simple to complex use-cases.
License #
This plugin is licensed for free under the MIT License.
Requirements #
This plugin requires Craft CMS 5.0.0 or later.
Installation #
To install the plugin, search for “Datastar” in the Craft Plugin Store, or install manually using composer.
composer require putyourlightson/craft-datastar:^1.0.0-alpha.1
Usage #
WIP
Have a suggestion to improve the docs? Create an issue with details, and we'll do our best to integrate your ideas.