At the core of access to reactions work in twig, is the reactions work service (facade).
Retrieve it like this (the comment is for PHPStorm IDE with Symfony plugin for code completion)
{% set reactions_work = craft.reactions_work %}
{# reactions_work \twentyfourhoursmedia\reactionswork\services\ReactionsWorkFacade #}
results in:
Return all enabled reaction handles.
{{ dump(reactions_work.reactionHandles) }}
array(7) { ["like"]=> string(4) "like" ["love"]=> string(4) "love" ["haha"]=> string(4) "haha" ["wow"]=> string(3) "wow" ["sad"]=> string(3) "sad" ["angry"]=> string(5) "angry" ["custom1"]=> string(6) "amazed" }
Checks if a user is allowed to react on a Craft Element
{% if reactions_work.isReactable(currentUser, entry) %}
{# show the form or something %}
{% endif %}
Submits a reaction for a user to an element (or unreact - undo the reaction)
Returns the reactions model for the element
{% do reactions_work.react('amazed', entry, currentUser) %}
{% set reactions = reactions_work.react('amazed', entry, currentUser) %}
{% do reactions_work.unreact('amazed', entry, currentUser) %}
{# reverses the amazed reaction #}
{% do reactions_work.toggle('amazed', entry, currentUser) %}
Returns the reactions model for an element
{% set reactions = reactions_work.reactions(entry) %}
Helper function to retrieve some users from their id's in the original order
{% set reactions = reactions_work.reactions(entry) %}
{% set users = reactions_work.usersFromIds(reactions.allUserIds | slice(0,2)) %}
{% for user in users %}{{ user.name }} {% endfor %}
Return a form url to post reactions to for a certain element.
getFormUrl expects a redirect, while getAjaxFormUrl returns json data.
Create a full form with all available reaction handles:
<form method="post" action="{{ reactions_work.formUrl(element, currentUser) }}">
{{ csrfInput() }}
{{ redirectInput(craft.app.request.url) }}
<input type="hidden" name="react" value="set" />
{% for handle in reactions_work.reactionHandles %}
{% if not canReact or reactions.canRegister(handle, currentUser) %}
<button name="reaction" {{ disabledAttr }} type="submit" class="btn btn-info" value="{{ handle }}">{{ handle }}</button>
{% endif %}
{% if reactions.canDeregister(handle, currentUser) %}
<button name="reaction" {{ disabledAttr }} type="submit" class="btn btn-danger" value="{{ handle }}">{{ handle }}</button>
{% endif %}
{% endfor %}
</form>