django-bootstrap5
django-bootstrap5 copied to clipboard
Feature Request: Add class to input element
It would be great if there fields would have a parameter that adds additional css classes to the input directly, just like label_class
does for the label. The parameter could be named input_class
.
Example:
{% bootstrap_field form.name label_class="visually-hidden" placeholder="Name" wrapper_class="mb-3" input_class="super-style" %}
Output:
<div class="mb-3">
<label class="form-label visually-hidden" for="id_name">Name</label>
<input type="text" name="name" class="form-control super-style" placeholder="Name" required="" id="id_name">
</div>