elements Directory¶
Purpose¶
This directory contains Django-Allauth template element components that provide reusable UI building blocks for authentication forms and interfaces. These elements follow a component-based approach, allowing for consistent styling and behavior across all authentication pages while maintaining customization flexibility.
Contents¶
alert.html: Alert message component for displaying notifications and feedbackbadge.html: Badge component for status indicators and labelsbutton.html: Button component with various styles and states for form actionsbutton__entrance.html: Specialized button styling for entrance/login pagesbutton_group.html: Button group component for related action buttonsfield.html: Form field wrapper component with error handling and stylingfields.html: Multiple form fields container with consistent spacingform.html: Form wrapper component with CSRF protection and validationform__entrance.html: Specialized form styling for entrance/login formsh1.html,h2.html: Header components with consistent typographyh1__entrance.html,h2__entrance.html: Specialized headers for entrance pageshr.html: Horizontal rule component for visual separationimg.html: Image component with responsive stylingp.html: Paragraph component with consistent text stylingpanel.html: Panel container component for grouped contentprovider.html: Social authentication provider button componentprovider_list.html: Container for multiple social provider buttonstable.html,tbody.html,td.html,th.html,thead.html,tr.html: Table components for tabular data display
Usage¶
Elements are imported and used within Allauth templates:
<!-- Example usage in authentication templates -->
{% load allauth_elements %}
{% element "form" form=form %}
{% element "fields" fields=form.visible_fields %}
{% element "button" type="submit" %}
Sign In
{% endelement %}
{% endelement %}
{% element "panel" %}
{% element "provider_list" providers=socialaccount_providers %}
{% endelement %}
Component features: - Consistent Styling: Bootstrap-based styling with custom theme integration - Accessibility: ARIA labels and semantic HTML structure - Responsive Design: Mobile-first responsive behavior - Form Validation: Error display and validation state styling - Social Authentication: Provider-specific styling and icons
Container Configuration¶
Elements are rendered server-side within Django templates: - CSS and JavaScript assets served from static files - Responsive design adapts to container viewport - Form elements include CSRF protection and validation - Error handling integrated with Django's form validation system
Related Paths¶
- Incoming: Used by Django-Allauth authentication templates and forms
- Outgoing: Renders HTML components for authentication user interfaces