Skip to content

Commit c6729ac

Browse files
author
Romaric Drigon
committed
Documentation for Bootstrap 4 custom switches
1 parent 0625d9c commit c6729ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

form/bootstrap4.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,16 @@ Custom Forms
9292
------------
9393

9494
Bootstrap 4 has a feature called "`custom forms`_". You can enable that on your
95-
Symfony Form ``RadioType`` and ``CheckboxType`` by adding a class called ``radio-custom``
96-
and ``checkbox-custom`` respectively.
95+
Symfony Form ``RadioType`` and ``CheckboxType`` by adding some classes over the label:
96+
- for radio, use ``radio-custom``
97+
- for a custom checkbox, use ``checkbox-custom``
98+
- for having a switch instead of a checkbox, use ``switch-custom``
9799

98100
.. code-block:: twig
99101
100102
{{ form_row(form.myRadio, {label_attr: {class: 'radio-custom'} }) }}
101103
{{ form_row(form.myCheckbox, {label_attr: {class: 'checkbox-custom'} }) }}
104+
{{ form_row(form.myCheckbox, {label_attr: {class: 'switch-custom'} }) }}
102105
103106
Labels and Errors
104107
-----------------

0 commit comments

Comments
 (0)