zostera / django-bootstrap5

Bootstrap 5 for Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Add class to input element

danielniccoli opened this issue · comments

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>