Reaction
Reaction component.
Reaction, Customization Blocks
The logic for persisting the reaction in a database, such as SQL, SQLite or Redis (cache) is up to its own algorithm. When an emoji is pressed, the react method is triggered, receiving the name of the reaction as a parameter.
use Livewire\Component; class MyComponent extends Component{ public function react(string $reaction) { // Your logic here... // $reaction will be thumbs-up, thumbs-down, the emoji name. }}
You can change the method that will receive the reaction using the react-method property:
<x-reaction react-method="reacting" />
<x-reaction />
#
Open on hover
NEW
<x-reaction hover />
An option to use GIF format instead of PNG.
<x-reaction animated />
<!-- Accept all positions of Tooltip component --> <x-reaction position="top" />
#
Tooltip Speed
NEW
<!-- accept all Tooltip delays --> <x-reaction delay="fast" />
<x-reaction balloon="red" />
An option for show the currently quantity of reactions.
<x-reaction :quantity="12" />
You can bind a property for real-time updates:
<!-- $quantity is an integer Livewire public property --> <x-reaction wire:model="quantity" :$quantity />
<!-- Available: 'smile', 'laugh', 'love', 'screaming', 'rage', 'pray', 'thumbs-up', 'thumbs-down', 'heart', 'broken-heart', 'clap', 'rocket', 'fire', 'mind-blown', 'sick', 'poop', 'eyes', 'party-popper', 'clown', 'check-mark' --> <x-reaction :only="['thumbs-up', 'thumbs-down', 'heart']" />
<x-reaction> React to the TallStackUI</x-reaction>
<x-reaction x-on:react="alert(`Reacted: ${$event.detail.reaction.reaction}`)" />
#
Panel
NEW
The emoji picker is now a JavaScript generated panel instead of Tippy's default black box. Since it exists outside customize() , use [data-tsui-popover] to style it.