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).

ui_patterns_settings

1,754 sites Security covered
View on drupal.org

Introduction

UI Patterns Settings extends the functionality of UI Patterns.

For UI Patterns Settings 2.x for UI Patterns 1.x, the module provided additional support for managing props. This integration remains unchanged and continues to work as before.

For UI Patterns Settings 3.x for UI Patterns 2.x, the scope of UI Patterns Settings has been completely redefined. Prop management is now a core part of UI Patterns itself. Instead, this module introduces new sources and UI addons to extend flexibility and design options for the drupal eco system. In UI Patterns only sources which are relating to drupal core are included. Sources for the contrib space will land in UI Pattern Settings.

UI Patterns Settings 3.x for UI Patterns 2.x

New sources:

  • Media and Media background
  • Color
  • Coloris
  • UI Styles (experimental)

UI Patterns UI addons:

  • Modify your Enums
  • Icon support for Enums
  • Fieldgroup support for UI Patterns UI

UI Patterns 1

Define settings inside your ui_patterns.yml to make your pattern configurable.
A setting can be a modifier, additional classes or attributes. You can also define a token setting, which makes it easy to configure a pattern with a Drupal field or pass a link URL to the pattern. No more hook_preprocess!

Layout Builder

Settings are useful in combination with UI Patterns Layout Builder. Each pattern can used as section and settings are very helpful to make the section more configurable

Sample Video:

https://www.youtube.com/watch?v=aDbZRgY7Xm8
Sample:

card:
  label: Card
  description: A card component.
  allow_variant_token: true
  allow_variant_expose: true
  settings:
    modifier:
      type: textfield
      label: Modifier
      description: Add modifier here
      allow_token: true
    url:
      type: token
      label: Url
      default_value: "[node:url]"
      expose_as_field: true
    select:
      type: select
      label: Select
      allow_expose: true
      options:
         key_1: Value 1
         key_2: Value 2
    attributes:
      type: attributes
      label: Attributes
    tabs:
      type: group
      label: Tabs
      group_type: horizontal_tabs
    tab:
      type: group
      label: Tab
      group_type: details
      group: tabs
    tab_element:
      type: textfield
      label: Textfield
      group: tab
    state_setting:
      states:
        visible:
         # Either a variant
          -
            variant: blue
        # Or another setting 
         -
            setting: select_config
            value: key2
    colorwidget:
      type: colorwidget
      label: Colorwidget  
      options:
         black:Black/#000000
        white:White/#ffffff
    coloriswidget:
      type: coloriswidget
      label: Coloriswidget  
      options:
         black:Black/#000000
        white:White/#ffffff
    media_library:
      type: media_library
      label: Media
      allowed_bundles:
        - image
      view_mode: teaser
      show_edit_button: true
      # OR
      # image_style: medium
      # OR 
      # responsive_image_style: resp_image
variants:
    product:
      label: Artwork
      settings:
        modifier: artwork
        attributes: "class=\"shadow-bottom\""
        media_library:
          definition:
            image_style: large
  fields:
    image:
      type: image
  configuration:
    config:
      config_key: config_value

.........

Let’s break this down:

States: (V2.1)

With states you can provide Form API states to Settings. As condition you can either provide a value of another setting or the variant name.

   my_setting:
      states:
        visible:
          -
            variant: blue
          -
            setting: select_config
            value: key2

ComplexSettingTypes: (V2.1)

TBD.

allow_token: true (V2)

With allow_token, you can allow token for any existing settings.

allow_expose: true (V2)

With allow_expose enabled you can expose this setting directly to a field storage.
The same works allow_variant_expose for variants.
After enabling, a drop-down with allowed settings appears during field generation if the field type matches to the settings type.

group (V2)

New setting type group. You can define every form element as container, fieldset, container as group_type. This works also with field_group form elements like horizontal_tabs. With the group key you can define your parent group.

checkbox => checkboxes

The checkbox setting type is renamed to checkboxes.

radios

New setting type radios.

colorwidget (V2)

New setting type colorwidget. Install colorwidget

coloriswidget (V2)

New setting type coloriswidget. Install coloriswidget

media library (V2)

New setting type media library. Install first: media_library_form_element

allow_variant_token

If you set allow_variant_token to true, a "Variant token" field appears under the variant select dropdown. You can specify a token (e.g. [node:field_variant:value]) to bind the variant selection to an entity field.

List of setting types

Each setting type is a plugin, so you can easily add your own settings type.
The following setting types are supported right now:

  • textfield
  • number
  • attributes
  • token
  • checkbox
  • checkboxes
  • radio
  • select
  • url
  • group
  • media_library
  • colorwidget
  • coloriswidget

This module works with ui_patterns:1.1

Assign setting values to variants:

You can assign setting values to variants. So a variant is a configuration bundle. All settings with no value can still be configured under manage display or with Layout Builder.

You can also overwrite the setting configuration for each variant. Use `definition` key to adjust the setting definition.

Compatibilty

This works with all UI Patterns submodules and with ui_patterns_layout_builder

Great modules:

Activity

Total releases
1
First release
Sep 2025
Latest release
7 months ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
3.0.0-alpha1 Pre-release Sep 16, 2025