Slots and Anonymous Components

Content between a component's tags is its $slot; <x-slot:title> fills a named slot, which arrives as $title with its own attributes. The alert of Layouts with Components prints a title only if given:

resources/views/components/alert.blade.phpPHP
@props(['type' => 'info'])
<aside {{ $attributes->merge(['role' => 'alert']) }}
  @style(['padding: .75rem 1rem', 'background: #fff3e0' => $type === 'warning'])>
  @isset($title)<strong {{ $title->attributes }}>{{ $title }}:</strong>@endisset {{ $slot }}
</aside>

$slot->isEmpty() and hasActualContent() test a slot. Anonymous components nest with dots (<x-forms.input> is components/forms/input.blade.php), and a folder's index.blade.php serves both <x-menu> and <x-menu.item>. A child reads a parent's prop with @aware(['color']), and Blade::anonymousComponentPath($dir, 'dashboard') adds a directory used as <x-dashboard::panel>.