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

20 lines
462 B
PHP

@props([
'sticky' => null,
])
@php
$classes = Flux::classes('[grid-area:aside]');
if ($sticky) {
$attributes = $attributes->merge([
'x-data' => '',
'x-bind:style' => '{ position: \'sticky\', top: $el.offsetTop + \'px\', \'max-height\': \'calc(100dvh - \' + $el.offsetTop + \'px)\' }',
'class' => 'max-h-[100vh] overflow-y-auto',
]);
}
@endphp
<div {{ $attributes->class($classes) }} data-flux-aside>
{{ $slot }}
</div>