On this page
Overview
How it works
Voting API Reaction provides a "Reaction" field type. When the field is added to an entity type, visitors see a row of reactions (like, love, laughing, surprised, sad, angry by default) on each entity and can pick one of them. Clicking a reaction submits it via AJAX; a no-JavaScript fallback with a submit button is included.
Under the hood, every reaction is a Voting API vote type, and every submitted reaction is stored as a Voting API vote. This means:
- Custom reactions can be created as vote types - see the "Create custom reactions" page of this guide.
- Vote results, storage, and cleanup follow the Voting API configuration.
- Each user has exactly one reaction per field. Picking another reaction replaces the current one, and clicking the same reaction again removes it.
Reactions can be opened, closed, or hidden per entity while editing it, similar to the comment settings on a node. Access is controlled by per-field permissions for viewing, creating, and modifying reactions.
Requirements
- Drupal 10.2 or higher.
- The Voting API module.
On Drupal 11, Voting API is only available in its 4.0.x branch. Until a stable 4.0.0 release is published (#3511188), it has to be required explicitly:
composer require drupal/votingapi:4.0.x-dev
Anonymous users and privacy
Anonymous visitors can react if their role has permission. Returning anonymous users are recognized by cookies, by IP address, or both, within a configurable rollover window. IP-based detection stores vote sources - review your site's privacy and data retention requirements (for example the GDPR) before enabling it.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion