sackey e839d40a99
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Initial commit
2025-07-30 17:15:50 +00:00

29 lines
718 B
PHP

@props([
'sticky' => null,
'container' => null,
])
@php
$classes = Flux::classes('[grid-area:header]')
->add('z-10 min-h-14')
->add($container ? '' : 'flex items-center px-6 lg:px-8')
;
if ($sticky) {
$attributes = $attributes->merge([
'x-data' => '',
'x-bind:style' => '{ position: \'sticky\', top: $el.offsetTop + \'px\', \'max-height\': \'calc(100vh - \' + $el.offsetTop + \'px)\' }',
]);
}
@endphp
<header {{ $attributes->class($classes) }} data-flux-header>
@if ($container)
<div class="mx-auto w-full h-full [:where(&)]:max-w-7xl px-6 lg:px-8 flex items-center">
{{ $slot }}
</div>
@else
{{ $slot }}
@endif
</header>