Forms and Widgets

Viewflow separates form logic from HTML rendering. You define field layout in Python. The template handles the HTML.

../_images/Form.png

Standard Django forms mix Python and HTML. You end up with widget attributes scattered across your code, or templates full of conditionals. Viewflow keeps them separate: Python controls which fields exist and their order, templates control how they look.

Viewflow renders forms using Google Material Web Components. The <vf-form/> web component handles form submission with Hotwire/Turbo, so pages don’t reload after submit. You get single-page app behavior without writing JavaScript.