← Back to Table of Contents
Summary
Single-select segmented control — alternative to radio lists or selects, with sliding animations, ghost variants, and optional icon-only modes.
Basic usage
Standard segments
Ghost variant with icons and full width
State & validation
Stored value
State is the option key from options().
Validation rules (built-in)
Configuration API
All methods accept Closure unless noted.
Public helper methods
Real-world examples
Responsive device selector (Icon only)
Date range selector (Ghost variant)
Playground
/admin/flex-fields/segment-control
See Playground for setup.
CSS classes (reference)
Shared rendering and overflow
Control, Tabs and locale tabs use one renderer and one lifecycle. The SSR strip is
styled before Alpine starts. A constrained field host enables automatic horizontal
scrolling, fading edges and chevrons when options exceed available width. Selection
is scrolled into view, including RTL layouts. fullWidth() distributes choices
instead. Arrow keys, Home and End skip disabled choices. No duplicated template or
observer is required when using the field inside CompositeField. Last modified on October 24, 2026