Bootstrap, the popular CSS framework, has evolved significantly over the years, with version 5 being the latest iteration. One of the most notable improvements in Bootstrap 5 is the revamped form controls, which are not only more responsive but also offer a cleaner, more modern look. Let's delve into some Bootstrap 5 form examples to help you understand and implement these changes in your projects.

Before we dive into the examples, it's crucial to note that Bootstrap 5 has dropped support for jQuery. This means that all the JavaScript components, including forms, are now powered by plain JavaScript. Let's explore how this affects form functionality and appearance.

Form Layout and Sizing
Bootstrap 5 introduces a new grid system with improved responsiveness. This new system allows for more control over form layout, making it easier to create responsive forms that adapt to different screen sizes.

Bootstrap 5 also introduces a new input sizing system. You can now use the `form-control-lg` and `form-control-sm` classes to create larger or smaller form controls, respectively. This provides more flexibility in designing forms that cater to various user needs.
Horizontal Form

Horizontal forms are a great way to align labels and inputs, making your forms more readable and user-friendly. In Bootstrap 5, you can create horizontal forms using the `row` and `col` classes. Here's an example:
<div class="row mb-3">
<label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="inputEmail3">
</div>
</div>
The `mb-3` class adds margin-bottom to the row, creating space between form groups. The `col-sm-2` class makes the label take up two columns on small screens and up, while the `col-sm-10` class makes the input take up the remaining ten columns.
Vertical Form

Vertical forms are the default form layout in Bootstrap 5. They are simple to create and work well on all screen sizes. Here's an example:
<div class="mb-3"> <label for="exampleFormControlInput1" class="form-label">Email address</label> <input type="email" class="form-control" id="exampleFormControlInput1" placeholder="name@example.com"> </div>
The `mb-3` class adds margin-bottom to the form group, creating space between form controls. The `form-label` class is used for the label, and the `form-control` class is used for the input.
Form Validation

Bootstrap 5 introduces a new form validation system that is more intuitive and easier to use. It uses the `is-valid` and `is-invalid` classes to provide visual feedback to users. Here's an example:
<div class="mb-3"> <label for="validationCustom01" class="form-label">First name</label> <input type="text" class="form-control" id="validationCustom01" required> <div class="valid-feedback">Looks good!</div> <div class="invalid-feedback">Please provide a valid first name.</div> </div>
The `required` attribute is used to mark the input as required. The `valid-feedback` and `invalid-feedback` classes are used to provide feedback to the user when the input is valid or invalid, respectively.




















In conclusion, Bootstrap 5's new form controls offer a cleaner, more modern look and improved responsiveness. With the new grid system, input sizing, and form validation system, creating responsive and user-friendly forms has never been easier. So, why not give these Bootstrap 5 form examples a try and see how they can enhance your projects? Happy coding!