--- layout: docs title: Forms description: Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms. group: components toc: true --- ## Overview Bootstrap's form controls expand on [our Rebooted form styles]({{ site.baseurl }}/docs/{{ site.docs_version }}/content/reboot/#forms) with classes. Use these classes to opt into their customized displays for a more consistent rendering across browsers and devices. The example form below demonstrates common HTML form elements that receive updated styles from Bootstrap with additional classes. Be sure to use an appropriate `type` attribute on all inputs (e.g., `email` for email address or `number` for numerical information) to take advantage of newer input controls like email verification, number selection, and more. ## Example Here's a quick example to demonstrate Bootstrap's form styles. Keep reading for documentation on required classes, form layout, and more. {% example html %}
We'll never share your email with anyone else.
{% endexample %} ## Form controls Textual form controls—like ``s, ` {% endexample %} For file inputs, swap the `.form-control` for `.form-control-file`. {% example html %}
{% endexample %} ### Sizing Set heights using classes like `.form-control-lg` and `.form-control-sm`. {% example html %} {% endexample %} {% example html %} {% endexample %} ### Readonly Add the `readonly` boolean attribute on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor. {% example html %} {% endexample %} ### Static If you want to have read-only fields in your form styled as plain text, use the `.form-control-static` class to remove the default form field styling and preserve the correct margin and padding. {% example html %}
{% endexample %} {% example html %}
{% endexample %} ## Checkboxes and radios Default checkboxes and radios are improved upon with the help of `.form-check`, **a single class for both input types that improves the layout and behavior of their HTML elements**. Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many. Disabled checkboxes and radios are supported, but to provide a `not-allowed` cursor on hover of the parent `