Going Further with Abstraction

  • Form inputs, labels, and error messages can be grouped into a single component
  • This allows switching between stacked and horizontal layouts from one place
  • Individual components should be small and focused — less is more
  • Jetstream's welcome page is a good example: it only contains the application logo
<x-app-layout>
    <x-slot name="header">
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            {{ __('Dashboard') }}
        </h2>
    </x-slot>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
                <x-jet-welcome />
            </div>
        </div>
    </div>
</x-app-layout>

← / → navigate · N notes · Esc exit