Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

Material UI Integration bridges Drupal with Google’s Material Design principles using Material-UI, a popular React component library. This module integrates responsive UI components as a Webforms element.

Introduction

Material UI Integration is a Drupal module that connects Google's Material Design with Drupal using Material-UI, a modern React component library. It empowers site builders to create visually engaging, responsive, and interactive interfaces with ease. The module includes seamless integration with Drupal Webforms, allowing Material-UI components to be added to forms and pages without custom code.

Key Features:

  • Dynamic integration of Material-UI components like sliders, buttons, and more.
  • Support for custom props and dynamic rendering via React.
  • Admin configuration options to manage Material UI settings.

Usage Instructions

1. Installation

  1. Place the material_ui_integration folder in web/modules/custom/.
  2. Enable the module:
    drush en material_ui_integration
  3. Clear the cache:
    drush cr

2. Configuration

Navigate to the settings page at Configuration → Development → Material UI Integration Settings.

  • Enable Material UI Integration: Toggle to enable or disable Material UI features.
  • Custom CSS Path: Specify a path to override Material-UI styling (optional).

3. Adding Material UI Components to Webforms

  1. Go to Structure → Webforms.
  2. Create or edit a Webform.
  3. Click Add Element and search for Material UI Element.
  4. Configure the element:
    • material_ui_component: Enter the name of the Material-UI component (e.g., Slider).
    • material_ui_props: Provide component properties in YAML format, e.g.:
       material_ui_props: defaultValue: 50 min: 0 max: 100 step: 10 
  5. Save the Webform and preview the changes.

4. Customizing Components

Extend the React app to add or modify components:

  • Edit js/react_app/components/MaterialUIComponent.js to add custom React components.
  • Rebuild the React app and clear Drupal's cache.

5. Debugging and Troubleshooting

  • Ensure Material UI libraries are loaded by inspecting the browser’s developer tools.
  • Check the browser’s console for JavaScript errors.
  • Clear cache if changes do not reflect:
    drush cr

Example: Adding a Slider to a Webform

  1. Add a Material UI Element to the Webform.
  2. Set material_ui_component to Slider.
  3. Set material_ui_props:
     material_ui_props: defaultValue: 50 min: 0 max: 100 step: 10 
  4. Save the Webform and preview the slider.

Feel free to share this structure in the module documentation or project page to assist collaborators!

Activity

Total releases
1
First release
Jan 2025
Latest release
1 year ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Jan 25, 2025