FilamentF
Filament6mo ago
jw

Programmatically change active Tab

Hi, I'm trying to change the active tab of the tabs form component.

I'm using this code to trigger a traditional html click event when a checkbox is ticked.

Is there a better way to do this? I tried things like setting the 'activeTab' but it didn't work.

TYIA

if ($state) {
$this->js("function clickGuardianTab() {
var guardianTabButton = Array.from(document.querySelectorAll('button[role="tab"]')).find(btn => btn.textContent.trim().toLowerCase() === 'guardian');
guardianTabButton.click();
}");
}
2025-07-19_15_38_50-filament_tab.png
Was this page helpful?