Appearance
Toggle
A Toggle renders as a Material switch: a 52x32dp track carrying a handle that changes size with what it has to say, 16dp bare, 24dp once it is on or carrying an icon, and larger again while pressed.




php
use Filament\Forms\Components\Toggle;
Toggle::make('notifications');The mark on a switch that is on is drawn rather than shipped as an icon, and only into the slot Filament leaves empty, so an onIcon() you asked for keeps the place.
With icons
Given icons of its own, the switch carries those in place of the check, and keeps the larger handle on both sides of the track:




php
use Filament\Support\Icons\Heroicon;
Toggle::make('visible')
->onIcon(Heroicon::OutlinedEye)
->offIcon(Heroicon::OutlinedEyeSlash);Colors


php
Toggle::make('notifications')->onColor('success');onColor() reaches the track, the handle and the mark on it. gray is the exception, which Filament emits no color classes for on a toggle.
Off
An unselected switch is neutral until a color is asked for. Given one, it takes that color's container for the track and its accent for the outline and the handle:


php
Toggle::make('notifications')->offColor('danger');