@props([ 'id' => null, 'tabs' => [], 'default' => null, 'label' => 'Section navigation', ]) @php $componentId = $id ?: 'ui-tabs-'.str()->random(8); $activeTab = (string) ($default ?: ($tabs[0]['id'] ?? '')); @endphp
class('ui-tabs')->merge([ 'id' => $componentId, 'data-ui-tabs' => true, 'data-default-tab' => $activeTab, ]) }} >
@foreach ($tabs as $tab) @php $tabKey = (string) ($tab['id'] ?? $loop->index); $isActive = $tabKey === $activeTab; $triggerId = $componentId.'_'.$tabKey.'_tab'; $panelId = $componentId.'_'.$tabKey.'_panel'; @endphp @endforeach
{{ $slot }}