November 4, 2019 Javier Eguiluz

Symfony provides a Bootstrap 4 based theme as one of the optional themes you can use to style the application forms. In Symfony 4.4 we've improved it with support for Bootstrap custom switches

Switches, also called flip switches and toggles, are a way to style regular checkboxes to make them look more modern and dynamic. You've probably seen them in lots of smartphone applications and web sites:

To use them in your Symfony forms, make sure to enable the Bootstrap 4 theme and add the switch-custom CSS class to the label of any CheckboxType form field: