Getting Started

Last updated on
11 May 2018

This module is compatible with both the Pattern Lab Standard Edition for Twig (which is the currently recommended edition for new projects by the Pattern Lab maintainers) and the Pattern Lab Twig Standard Edition for Drupal.

Your approach to installing and configuring the UI Patterns Pattern Lab may vary depending on the location of your Pattern Lab instance.

If Pattern Lab lives in the /templates directory in a module or theme:

  1. Install and enable the UI Patterns Pattern lab module. The dependencies ui_patterns and ui_patterns_library will also be enabled.
  2. Clear Drupal's caches.
  3. Navigate to /patterns on your Drupal site to confirm that your patterns from Pattern Lab have been recognized and are displayed on the Pattern Library page.
  4. The patterns displayed at /patterns are for demonstration purposes. To make use of them in Drupal you will need to enable one of the UI Patterns integration modules. For example, to use these patterns everywhere layouts are exposed in Drupal you could enable the ui_patterns_layouts module and follow the instructions to use UI Patterns as Layouts.
  1. Install and enable the UI Patterns Pattern lab module. The dependencies ui_patterns and ui_patterns_library will also be enabled.
  2. Your Drupal theme needs to be made aware of the location of your Pattern Lab templates. This is commonly achieved using the Component Libraries module. If you are already using Pattern Lab with your theme it is likely that this step has been completed, but if not:
    1. Install the component libraries module.
    2. in your theme's .info.yml file, add entries for one or more component libraries.  If for example Pattern Lab patterns were located in [path to theme]/pattern-lab/source/_patterns/ you could add the following: 
      component-libraries:
        patternlab:
          paths:
            - pattern-lab/source/_patterns
  3. Clear Drupal's caches.
  4. Navigate to /patterns on your Drupal site to confirm that your patterns from Pattern Lab have been recognized and are displayed on the Pattern Library page.
  5. The patterns displayed at /patterns are for demonstration purposes. To make use of them in Drupal you will need to enable one of the UI Patterns integration modules. For example, to use these patterns everywhere layouts are exposed in Drupal you could enable the ui_patterns_layouts module and follow the instructions to use UI Patterns as Layouts.

Help improve this page

Page status: No known problems

You can: