Skip to content

Commit

Permalink
Document approach to Bootstrap 5 form rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed Mar 16, 2021
1 parent c8312e0 commit 6320c68
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ See below for an example.
<div class="valid-feedback">Looks good!</div> <!-- validation text -->
</div>

How and in which order these will components be rendered differs per widget type.
How and in which order these will components be rendered differs per widget type.

1. We must support `bootstrap_formset`, `bootstrap_form`, and `bootstrap_field` to render a sensible default layout for the above components.
2. We should offer support to easily set or override the classes for the wrapper.
3. We could offert the option to override the templates used to generate this output.

Input groups for more complex fields
------------------------------------

Reference: https://getbootstrap.com/docs/5.0/forms/input-group/

Bootstrap 5 offers Input groups to combine fields and add-ons (both before and after the field).

1. We must support separate rendering of labels, fields, help texts and errors so that users can build their own input groups.
2. We should offer support for add-ons (before and after) as part of `bootstrap_field`.
3. We could add support in form, field or widget definition to define add-ons in Python code.

0 comments on commit 6320c68

Please sign in to comment.