V2 is in public beta! 🎉 Report any issues on the repository.

Powerful suite of Blade components for TALL Stack apps.

Layout

Layout component.

The version 2.x of the TallStackUI introduces a new layout component for dashboard creation. While this component is simple, it is complete in every way. Due to the format of the TallStackUI documentation, there will be no code examples of the layout that makes it display.

Here is a complete example of using the layout component:

<body>
 
<x-layout>
<x-slot:header>
<x-layout.header>
<x-slot:right>
<x-dropdown text="Hello, {{ auth()->user()->name }}!">
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-dropdown.items text="Logout" onclick="event.preventDefault(); this.closest('form').submit();" />
</form>
</x-dropdown>
</x-slot:right>
</x-layout.header>
</x-slot:header>
 
<x-slot:menu>
<x-side-bar>
<x-side-bar.item text="Home" icon="home" :route="route('dashboard')" />
<x-side-bar.item text="Settings" icon="cog" :route="route('settings')" />
</x-side-bar>
</x-slot:menu>
 
{{ $slot }}
</x-layout>
 
@livewireScripts
</body>

Before continuing, you may have noticed the following:

  • The layout component has multiple slots
  • The layout component has other components, such as layout.header
  • In this example, we are using other components from TallStackUI, such as dropdown
Layout Slots

This slot is used to position the component layout.header :

<x-slot:header>
<x-layout.header>
<!-- ... -->
</x-layout.header>
</x-slot:header>

This slot is used to position the comonent side-bar :

<x-slot:menu>
<x-side-bar>
<!-- ... -->
</x-side-bar>
</x-slot:menu>

Although it was not used in the example above, this slot is positioned above the menu slot and was created to receive any content added in this position. Internally it is applied like this:

<div x-data="{ tallStackUiMenuMobile : false }" x-on:tallstackui-menu-mobile.window="tallStackUiMenuMobile = $event.detail.status">
@if ($top)
{{ $top }}
@endif
@if ($menu)
{{ $menu }}
@endif
 
<!-- ... -->
</div>
Children Components

The layout.header component is used to group three specific slots that vary the positions of content in the top horizontal bar, called the header.

<x-layout.header>
<x-slot:left>
<!-- ... -->
</x-slot:left>
 
<x-slot:middle>
<!-- ... -->
</x-slot:middle>
 
<x-slot:right>
<!-- ... -->
</x-slot:right>
</x-layout.header>
  • left : adds content to the left of the horizontal bar
  • middle : adds content to the middle of the horizontal bar
  • right : adds content to the right of the horizontal bar

Additionally, you can control the display of a button that opens the side-bar on mobile devices. You will learn more about this as you continue reading the documentation below.

All the components mentioned above are available to be fully customized through one of the TallStackUI personalization methods: soft personalization or deep personalization.

Code highlighting provided by Torchlight