putyourlightson/craft-sprig-core

A reactive Twig component framework for Craft.

Package info

github.com/putyourlightson/craft-sprig-core

Documentation

Type:yii-module

pkg:composer/putyourlightson/craft-sprig-core

Fund package maintenance!

bencroker

Statistics

Installs: 352โ€‰850

Dependents: 5

Suggesters: 0

Stars: 4

Open Issues: 0

3.7.2 2026-02-17 23:23 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

mit a9cf486c1adaa4ca5f08c39b5d4f70f585668774


README

๐Ÿ‘ Stable Version
๐Ÿ‘ Total Downloads

๐Ÿ‘ Image

Sprig Core Module for Craft CMS

This module provides the core functionality for the Sprig plugin, a reactive Twig component framework for Craft CMS. If you are developing a Craft plugin/module and would like to use Sprig in the control panel, then you can require this package to give you its functionality, without requiring that the site has the Sprig plugin installed.

First require the package in your plugin/moduleโ€™s composer.json file.

{
 "require": {
 "putyourlightson/craft-sprig-core": "^2.0"
 }
}

Then bootstrap the module from within your plugin/moduleโ€™s init method.

use craft\base\Plugin;
use putyourlightson\sprig\Sprig;

class MyPlugin extends Plugin
{
 public function init()
 {
 parent::init();

 Sprig::bootstrap();
 }
}

Then use the Sprig function and tags as normal in your control panel templates.

{{ sprig('_components/search') }}

If your plugin/module registers an asset bundle that depends on htmx being loaded, ensure that you specify the HtmxAssetBundle class as a dependency.

use craft\web\AssetBundle;
use putyourlightson\sprig\assets\HtmxAssetBundle;

class MyAssetBundle extends AssetBundle
{
 public $depends = [
 HtmxAssetBundle::class,
 ];
}

Sprig plugin issues should be reported to https://github.com/putyourlightson/craft-sprig/issues

The Sprig plugin changelog is at https://github.com/putyourlightson/craft-sprig/blob/develop/CHANGELOG.md

Documentation

Learn more and read the documentation at putyourlightson.com/plugins/sprig ยป

To see working examples and video tutorials, visit the learning resources.

License

This package is licensed for free under the MIT License.

Requirements

This module requires Craft CMS 3.1.19 or later, or 4.0.0 or later, or 5.0.0 or later.

Installation

Install this package via composer.

composer require putyourlightson/craft-sprig-core

Created by PutYourLightsOn.