
Reactions
Universal reactions for MODX 3 — likes, GitHub-style sets, tops and trending on any object


Minimal path: load assets, call the snippet, click a reaction.
In the template or via registerClientScript / registerClientCSS.
<link rel="stylesheet" href="[[++assets_url]]components/reactions/js/web/reactions.css">
<script src="[[++assets_url]]components/reactions/js/web/reactions.js" defer></script><link rel="stylesheet" href="{'assets_url' | config}components/reactions/js/web/reactions.css">
<script src="{'assets_url' | config}components/reactions/js/web/reactions.js" defer></script>Auto-init and data attributes: JavaScript widget.
On a resource page (github set). With layout=auto (default) the widget draws a compact picker: chips + + button. For updown you still get a two-button strip.
[[!Reactions? &set=`github`]]
[[!Reactions? &set=`updown`]]
[[!Reactions? &set=`github` &layout=`bar`]]{'!Reactions' | snippet : ['set' => 'github']}
{'!Reactions' | snippet : ['set' => 'updown']}
{'!Reactions' | snippet : ['set' => 'github', 'layout' => 'bar']}Without &set, the snippet uses reactions_default_set (default updown).
miniShop3 product:
[[!Reactions?
&class=`msProduct`
&object=`[[*id]]`
&set=`updown`
]]{'!Reactions' | snippet : [
'class' => 'msProduct',
'object' => $_modx->resource.id,
'set' => 'updown',
]}Parameters and chunks: Reactions snippet.
curl "https://example.com/assets/components/reactions/api.php?action=counts&class_key=modResource&object_id=1&context=web"The widget fetches CSRF and updates counts over AJAX.
After install or setting changes: Manage → Clear Cache.
Next: