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)

PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Import Data Form Excel to Tally Services
Tally xperts
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Ad

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