Reaction
An emoji reaction button for chat messages, comments, and social interactions. Supports active/inactive toggle state, count display, and screen-reader-friendly user lists.
Basic Usage
Simple reaction
Active State
Highlight a reaction the current user has selected:
Active vs inactive
Zero Count (Hidden)
When count is zero, only the emoji is shown:
Zero count reaction
With User List
Provide a list of users for screen reader context:
Reaction with user attribution
With Livewire Integration
Livewire toggle example
Props
| Prop | Type | Default | Description |
|---|---|---|---|
emoji |
string |
null |
The emoji character to display |
count |
int |
0 |
Number of reactions |
active |
bool |
false |
Whether the current user has reacted |
users |
array |
[] |
List of user names (for screen readers) |
Accessibility
<button type="button">for keyboard activationaria-pressed="true|false"reflects active statearia-labelcombines emoji with reaction count (e.g. "👍, 5 people reacted")- When
usersis provided, asr-onlyspan witharia-describedbylists all names
Keyboard Interaction
| Key | Action |
|---|---|
Tab |
Move focus to the button |
Enter / Space |
Activate the button |
Pitfalls
- Don't bind
wire:click.liveon every reaction button. Each click round-trips to the server with full component state. The component's:on-reactcallback prop debounces; use it.
Design Tokens
| Token | Used for |
|---|---|
--font-wk-sans |
Button font family |
--font-wk-heading-weight |
Count weight |
--text-wk-sm |
Count font size |
--color-wk-text-muted |
Inactive count text |
--color-wk-accent / --color-wk-accent-content |
Active border + count text |
--color-wk-bg / --color-wk-bg-elevated / --color-wk-bg-muted |
Background per active / hover state |
--color-wk-border |
Inactive border |
--border-wk-width |
Border width |
--radius-wk-full |
Pill border radius |
--transition-wk-duration / --transition-wk-easing |
Hover / toggle transition |