When you use your component:
<x-ema></x-ema>
you need to pass a value for your required prop trigger. So it should be like this:
<x-ema trigger=""></x-ema>
https://laravel.com/docs/9.x/blade#passing-data-to-components
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi :)
@props(['trigger'])
<div x-data="{ show: false }" @click.away="show = false" class="relative">
{{--Trigger--}}
<div @click="show = !show">
{{ $trigger }}
</div>
{{--Links--}}
<div x-show="show" style="display: none">
{{ $slot }}
</div>
</div>
<x-ema>
<x-slot name="trigger">
<button class="text-xs font-bold uppercase">Plant</button>
</x-slot>
<div>Details of plant</div>
</x-ema>
Thanks :)
Please or to participate in this conversation.