SlideShare a Scribd company logo
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
✈
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
⚛
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
⚛
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
./templates/views-view-fields--articles--page.html.twig
{% embed "@molecules/cards/card.twig"
with {
"url": fields.path.content,
"title": fields.title.content,
"read_more": "Read more"|t,
"card_header": fields.created.content,
}
%}
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
YAML
MY_MODULE.ui_patterns.yml MY_THEME.ui_patterns.yml
pattern
media
pattern_media
pattern-media.html.twig
./themes/custom/MY_THEME/MY_THEME.ui_patterns.yml
blockquote:
label: Blockquote
description: Display a quote with attribution information
fields:
quote:
type: text
label: Quote
preview: Life is like riding a bicycle. To keep your balance, you must keep moving.
attribution:
type: text
label: Attribution
preview: Albert Einstein
./themes/custom/MY_THEME/templates/pattern-blockquote.html.twig
<blockquote>
<p>{{ quote }}</p>
<footer>{{ attribution }}</footer>
</blockquote>
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
id
label description
fields
type label description preview
blockquote:
label: Blockquote
description: Display a quote with attribution information
fields:
quote:
type: text
label: Quote
preview: Life is like riding a bicycle. To keep your balance, you m
preview
id: image
fields:
image_field:
...
preview:
theme: image
uri: http://lorempixel.com/350/250/nature/1
id: gallery
fields:
gallery_field:
...
preview:
type: pattern_preview
id: image
theme hook
pattern_[id]
template
pattern_[id]
use
use: "@my_module/templates/my-template.html.twig"
use: "@molecules/media/media.html.twig"
.
├── templates
│ └── patterns
│ ├── button
│ │ ├── button.ui_patterns.yml
│ │ └── pattern-button.html.twig
│ ├── media
│ │ ├── media.ui_patterns.yml
│ │ └── pattern-media.html.twig
...
│ └── pattern-jumbotron.html.twig
├── MY_THEME.info.yml
└── MY_THEME.ui_patterns.yml
media:
label: Media object
...
libraries:
- core/jquery.ui.autocomplete
- my_module/my_library
- local_library:
css:
component:
media1.css: {}
http://example.com/style.css: { type: external }
...
└── patterns
└── media
├── media1.css
├── media.ui_patterns.yml
└── pattern-media.html.twig
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
/**
* The YAML UI Pattern plugin.
*
* @UiPattern(
* id = "yaml",
* label = @Translation("YAML Pattern"),
* description = @Translation("Pattern defined using a YAML file."),
* deriver = "Drupalui_patternsPluginDeriverYamlDeriver"
* )
*/
class YamlPattern extends UiPatternBase implements UiPatternInterface
...
}
/**
* The Fractal UI Pattern plugin.
*
* @UiPattern(
* id = "fractal",
* label = @Translation("Fractal"),
* description = @Translation("Pattern defined using Fractal."),
* deriver = "Drupalui_patternsPluginDeriverFractalDeriver"
* )
*/
class FractalPattern extends UiPatternBase implements UiPatternInterface
...
}
/**
* The PatternLab plugin.
*
* @UiPattern(
* id = "pattern_lab",
* label = @Translation("PatternLab"),
* description = @Translation("Pattern defined using PatternLab."),
* deriver = "Drupalui_patternsPluginDeriverPatternLabDeriver"
* )
*/
class PatternLabPattern extends UiPatternBase implements UiPatternInterfa
...
}
COMPONENT.ui_patterns.yml
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
ui_patterns_layouts
ui_patterns_views
ui_patterns_ds
ui_patterns_field_group
/articles
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8
Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8

More Related Content

Similar to Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8 (18)

PPTX
News Specific Crawl Errors
MMI Online Limited - Jagran Prakashan Ltd
 
TXT
Frfrfrf
Nelinho Pereira
 
PPTX
Lesson 3
hstryk
 
KEY
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
PPTX
The Django Web Application Framework 2
fishwarter
 
PPTX
The Django Web Application Framework 2
fishwarter
 
PPTX
The Django Web Application Framework 2
fishwarter
 
PPTX
The Django Web Application Framework 2
fishwarter
 
PDF
Html / CSS Presentation
Shawn Calvert
 
PPTX
Customizing the Appearance and HTML Output of Visualforce Pages
Mohammed Safwat Abu Kwaik
 
PPTX
Saigon Wordpress Meetup - Themes Wordpress Meetup
Triết Sài Gòn
 
PPTX
Frontend Devlopment internship batch 2024.pptx
bankheleom
 
PPTX
Frontend Devlopment internship batch 2024-2.pptx
bankheleom
 
DOC
Handout6 html frames
Nadine Guevarra
 
PPT
Html frames
Arslan Elahi
 
PDF
Bootstrap 3 Cheat Sheet PDF Reference
Bootstrap Creative
 
KEY
Html intro
Robyn Overstreet
 
News Specific Crawl Errors
MMI Online Limited - Jagran Prakashan Ltd
 
Lesson 3
hstryk
 
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
fishwarter
 
Html / CSS Presentation
Shawn Calvert
 
Customizing the Appearance and HTML Output of Visualforce Pages
Mohammed Safwat Abu Kwaik
 
Saigon Wordpress Meetup - Themes Wordpress Meetup
Triết Sài Gòn
 
Frontend Devlopment internship batch 2024.pptx
bankheleom
 
Frontend Devlopment internship batch 2024-2.pptx
bankheleom
 
Handout6 html frames
Nadine Guevarra
 
Html frames
Arslan Elahi
 
Bootstrap 3 Cheat Sheet PDF Reference
Bootstrap Creative
 
Html intro
Robyn Overstreet
 

More from Nuvole (10)

PDF
The OpenEuropa Initiative
Nuvole
 
PDF
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
Nuvole
 
KEY
Automating Drupal Development: Makefiles, features and beyond
Nuvole
 
PDF
Building and Maintaining a Distribution in Drupal 7 with Features
Nuvole
 
KEY
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
Nuvole
 
KEY
Public Works Monitoring
Nuvole
 
PDF
Extending and Customizing Open Atrium
Nuvole
 
PDF
Code driven development: using Features effectively in Drupal 6 and 7
Nuvole
 
PDF
Features based development workflow
Nuvole
 
ZIP
First Steps in Drupal Code Driven Development
Nuvole
 
The OpenEuropa Initiative
Nuvole
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
Nuvole
 
Automating Drupal Development: Makefiles, features and beyond
Nuvole
 
Building and Maintaining a Distribution in Drupal 7 with Features
Nuvole
 
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
Nuvole
 
Public Works Monitoring
Nuvole
 
Extending and Customizing Open Atrium
Nuvole
 
Code driven development: using Features effectively in Drupal 6 and 7
Nuvole
 
Features based development workflow
Nuvole
 
First Steps in Drupal Code Driven Development
Nuvole
 
Ad

Recently uploaded (20)

PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Executive Business Intelligence Dashboards
vandeslie24
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Import Data Form Excel to Tally Services
Tally xperts
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Ad

Introducing the UI Patterns module: use atomic UI components everywhere in Drupal 8