Example of Blade components in guillaumebriday/laravel-blog

File app/View/Components/Alert.php (link to Github)
use Illuminate\View\Component;
use Illuminate\View\View;

class Alert extends Component
{
    public string $type;
    public ?string $dismissible;

    public function __construct(string $type, string $dismissible = null)
    {
        $this->type = $type;
        $this->dismissible = $dismissible;
    }

    public function render(): View
    {
        return view('components.alert');
    }
}
File resources/views/shared/alerts.blade.php (link to Github)
@if (Session::has('success'))
    <x-alert type="success" :dismissible="true">
        {{ Session::get('success') }}
    </x-alert>
@endif

@if (Session::has('errors'))
    <x-alert type="danger" :dismissible="true">
        @if ($errors->count() > 1)
            {{ trans_choice('validation.errors', $errors->count()) }}
            <ul>
                @foreach($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        @else
            {{ $errors->first() }}
        @endif
    </x-alert>
@endif
File resources/views/comments/_form.blade.php (link to Github)
@auth
  <comment-form
      :post-id="{{ $post->id }}"
      placeholder="@lang('comments.placeholder.content')"
      button="@lang('comments.comment')">
  </comment-form>
@else
  <x-alert type="warning">
    @lang('comments.sign_in_to_comment')
  </x-alert>
@endauth

Additional resources on blade components: