Skip to main content
FlexSlider ← Back to Table of Contents

Summary

Styled wrapper around Filament’s Slider with a SaaS-like pill rail, accent fill, capsule thumb, and optional in-track step dots. Supports single values or dual-handle ranges with server-rendered pips and fill segments to prevent layout shift.
ClassBjanczak\FilamentFlexFields\Filament\Forms\Components\FlexSlider
State typeint|float or [min, max] for range
FieldTypeflex_slider
ParentFilament\Forms\Components\Slider
Playgroundflex-slider slug in Flex Fields playground
Inherits all functionality from the standard Filament Slider while adding advanced visual customization.

Basic usage

Standard Volume Slider

use Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexSlider;

FlexSlider::make('volume')
    ->range(0, 100)
    ->step(5)
    ->showValue()
    ->suffix('%')
    ->color('primary');

Dual-Handle Price Range

FlexSlider::make('price_range')
    ->range(0, 1000)
    ->step(10)
    ->fillTrack([false, true, false]) // Fill between handles
    ->prefix('$')
    ->trackLabel('Budget');

State & validation

Stored value

State is a numeric value or an array of two numeric values for range mode.
$record->volume; // 65
$record->price_range; // [200, 800]

Validation rules

Inherits Filament Slider rules (min, max, step, etc.).

Configuration API

All methods accept Closure unless noted.
MethodTypeDefaultDescription
showValue(bool $condition)SetupfalseDisplay current value in footer
prefix(string $prefix)SetupnullValue prefix
suffix(string $suffix)SetupnullValue suffix
variant(string $variant)Setup'default'default, secondary
trackLabel(string $label)SetupnullLabel shown inside or above track
hideThumbUntilInteraction(bool $condition)SetupfalseThumb appears on hover/drag
valuePosition(string $position)Setup'end'Footer value position: start, center, end
autoFill(bool $condition)SetupfalseAutomatically fill segments between handles
color(string $color)Setup'primary'Filament color for track/thumb
fillColor(string $color)SetupnullCustom hex/rgb for fill accent
showStepDots(bool $condition)SetupfalseRender dots at each step interval
size(string $size)Setup'md'sm, md, lg

Real-world examples

Opacity Control with Tooltips

FlexSlider::make('opacity')
    ->range(0, 100)
    ->step(5)
    ->suffix('%')
    ->fillTrack()
    ->tooltips()
    ->default(100);

Rating Scale with Pips

FlexSlider::make('rating')
    ->range(0, 5)
    ->step(1)
    ->pips(\Filament\Forms\Components\Slider\Enums\PipsMode::Steps)
    ->showStepDots();

Playground

/admin/flex-fields-playground/flex-slider See Playground for setup.
ComponentWhen to use instead
TrackSliderMinimalist track-based slider without handles
NumberStepperPrecise numeric stepping with buttons
RatingFieldStar-based rating input

CSS classes (reference)

ClassRole
fff-flex-sliderRoot wrapper
fff-flex-slider--{sm|md|lg}Size variant
fff-flex-slider--{variant}Visual variant
fff-flex-slider__controlMain slider container
fff-flex-slider__railInteractive track area
fff-flex-slider__fillActive range fill
fff-flex-slider__thumbDraggable handle
fff-flex-slider__pipScale marker
fff-flex-slider__step-dotStep interval indicator
fff-flex-slider__footerValue display area
is-disabledDisabled state
is-rangeRange mode active