Summary
Schema layout component: iOS-style segmented tabs with per-tab form schemas (same visual language as SegmentControl). Used directly and as the base for TranslatableFields.| Class | Bjanczak\FilamentFlexFields\Filament\Schemas\Components\SegmentTabs |
| Tab class | Bjanczak\FilamentFlexFields\Filament\Schemas\Components\SegmentTabs\SegmentTab |
| State | Tab panels contain nested fields; tab selection is local UI state (optional query-string persistence) |
Basic usage
Configuration API
tabs(array|Closure $tabs)
Array of SegmentTab components. Each tab wraps a nested schema.
activeTab(int|Closure $activeTab)
1-based index of the initially active tab. Default: 1.
persistTabInQueryString(string|Closure|null $key = 'segment-tab')
Persist the active tab in the URL query string. Pass null to disable.
variant(string|Closure $variant)
| Value | Description |
|---|---|
default | Filled track background. Default. |
ghost | Transparent track; uses color() for selection accent. |
color(string|Closure|null $color)
Selection accent color. For ghost, defaults to primary when omitted.
separators(bool|Closure $condition = true)
Vertical dividers between tab segments. Default: true.
fullWidth(bool|Closure $condition = true)
Stretch tabs to the full container width.
iconOnly(bool|Closure $condition = true)
Hide tab labels; show icons only (requires icons on tabs).
expandSelectedLabel(bool|Closure $condition = true)
Animate the selected tab to a wider width.
size(string|ControlSize|Closure $size)
See Control size.
SegmentTab API
| Method | Description |
|---|---|
make(string|Htmlable|Closure|null $label) | Create a tab |
icon(string|BackedEnum|Htmlable|Closure|null $icon) | Tab icon |
tooltip(string|Closure|null $tooltip) | Hover tooltip |
schema(array|Closure $schema) | Nested form/schema components |
badge(...) | Inherited Filament badge API |
visible(...) / hidden(...) | Inherited visibility API |
Getters
| Method | Returns |
|---|---|
getVisibleTabs() | list<SegmentTab> — visible tabs only |
getActiveTab() | int — 1-based active index |
getActiveTabKey() | ?string — key of active tab |
isTabActive(SegmentTab $tab) | bool |
isTabPersistedInQueryString() | bool |
getTabQueryStringKey() | ?string |