Centered Layout

Bring focus to your content with our Centered Layout component. Perfect for login screens, registration forms, and other user-focused pages, it keeps everything neatly centered, making it easy for users to stay engaged without distractions.

Adding the component

php artisan spur:add layouts/centered-layout

If you use this to add the component, it will automatically add it to config/spur.php and auto-fetch the components files.

config/spur.php
"components": [
  'layouts/centered-layout',
]

If you manually add the component in config/spur.php you would need to run
php artisan spur:fetch to import the component

Usage

Example

<x-spur.centered-layout>
  <x-slot name="header">
    <x-components.spur-logo class="h-10"/>
  </x-slot>

  <x-spur.field id="email">
    <x-spur.label>Email</x-spur.label>
    <x-spur.input type="email" placeholder="Email" />
  </x-spur.field>

  <x-spur.field id="password">
    <x-spur.label>Password</x-spur.label>
    <x-spur.input type="password" placeholder="Password" name="password" />
  </x-spur.field>

  <div class="flex justify-end items-center gap-2 mt-5">
    <x-spur.button plain>Register</x-spur.button>
    <x-spur.button color="light">Login</x-spur.button>
  </div>
</x-spur.centered-layout>