X Enterprises
nuxt-x-affiliate

Reactions

Helpful / Not helpful

Reactions

The XAFReactions component renders small "Was this helpful?" reaction buttons under the article body. Default pair is 👍 Helpful / 👎 Not helpful, but the options prop accepts any reaction set. Emits vote and optionally POSTs to your endpoint.

Components

<XAFReactions />

<XAFReactions post-id="mx-keys-s-review" endpoint="/api/reactions" @vote="onVote" />

Props

PropTypeDefaultDescription
optionsReaction[]helpful / not helpfulReaction options. Each carries { id, label, emoji? }.
postIdstringTracking ID for analytics.
initialstringPre-selected option ID — for restoring user state.
endpointstringPOST { postId, reaction } here.

Events

EventPayloadDescription
vote{ reaction, postId? }Fired on every vote (independent of the endpoint POST).

The selected button shows the active state with aria-pressed="true". Counts are local-only — wire to a real endpoint to persist.


AI Context

component: XAFReactions
package: "@xenterprises/nuxt-x-affiliate"
use-when: "Helpful / Not helpful" reaction buttons with optional POST for analytics.
Copyright © 2026