Customized form classes that uses widgets built with Material Components for the Web.

MaterialForm and MaterialModelForm modifies django.forms.Form and django.forms.ModelForm respectively, and are used to declare Django forms that will render with Material widgets.


Material Design for the Web

class material_widgets.forms.MaterialForm(*args, **kwargs)[source]

Modified django.forms.Form that uses material_widgets.widgets.


Declare your Form fields as usual but subclass MaterialForm instead of django.forms.Form.

>>> class ExampleForm(MaterialForm):
>>>     username = forms.CharField(required=True)
class material_widgets.forms.MaterialModelForm(*args, **kwargs)[source]

Modified django.forms.ModelForm that uses material_widgets.widgets.


Declare your ModelForm Meta as usual but subclass MaterialModelForm instead of django.forms.ModelForm.

>>> class ExampleModelForm(MaterialModelForm):
>>>     class Meta:
>>>         model = ExampleModel
>>>         fields = '__all__'