Real-world component libraries at scale

Stefan Baumgartner
Stefan BaumgartnerWeb Architect at Dynatrace
Real-world component
libraries at scale
ngVikings 2019
@ddprrt @Ka_TriN_F
Slide about usKatrin Freihofner

@Ka_TriN_F
barista.dynatrace.com
Slide about usStefan Baumgartner

@ddprrt
scriptconf.org
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Designer : Developer
Designer : Developer
Designer : Developer
Real-world component libraries at scale
Real-world component libraries at scale
Patterns
Barista Design System
Angular components
Barista Design System
A collection of reusable components,
patterns, and styles. 
Barista Design System
Single source of truth
…in code
Real-world component libraries at scale
Real-world component libraries at scale
button
button link
button link toggle
The appearance of a component is
coupled to its behaviour and can’t be
separated.
Developer experience
Real-world component libraries at scale
Code examples
Real-world component libraries at scale
Do it like
Material
Do
it
like
Material
Okay…
Let’s look at Material
Component infrastructure and
Material Design components for Angular
https://github.com/angular/components
Angular Devs know Material
Real-world component libraries at scale
Why not Material directly?
Real-world component libraries at scale
Component Development Kit
Straightforward APIs that don't confuse
developers
https://github.com/angular/components
$white: #ffffff;
$turquoise-100: #e1f7f9;
$turquoise-200: #aeebf0;
$turquoise-300: #74dee6;
$turquoise-400: #4fd5e0;
$turquoise-500: #00b9cc;
$turquoise-600: #00a1b2;
$turquoise-700: #00848e;
$turquoise-800: #006d75;
$turquoise-900: #005559;
$green-100: #e8f9dc;
$green-200: #d2efbe;
$green-300: #bee5a3;
$green-400: #9cd575;
$green-500: #7dc540;
$green-600: #5ead35;
$green-700: #3f962a;
$green-800: #1f7e1e;
$green-900: #006613;
$blue-100: #e0f4fc;
$blue-200: #b4e5f9;
$blue-300: #74cff7;
$blue-400: #2ab6f4;
$blue-500: #14a8f5;
$blue-600: #008cdb;
900: $yellow-900,
),
'shamrockgreen': (
100: $shamrockgreen-100,
200: $shamrockgreen-200,
300: $shamrockgreen-300,
400: $shamrockgreen-400,
500: $shamrockgreen-500,
600: $shamrockgreen-600,
700: $shamrockgreen-700,
800: $shamrockgreen-800,
900: $shamrockgreen-900,
),
'gray': (
100: $gray-100,
200: $gray-200,
300: $gray-300,
400: $gray-400,
500: $gray-500,
600: $gray-600,
700: $gray-700,
800: $gray-800,
900: $gray-900,
),
);
@function get-color($color, $shade) {
@return map-get(map-get($full-color-palette, $color), $shade);
}
Real-world component libraries at scale
Defensive components
Work in any context. Any environment.
Real-world component libraries at scale
Layout vs Styling
Layout defines structure
Components are fluid
width: auto;
max-width: 100%;
text-overflow: ellipsis;
Intrinsic width
constrained by layout
width: 100%;
Set width
constrained by layout
Respect HTML elements
.dt-button {
@include main-font(30px);
box-sizing: border-box;
position: relative;
// Reset browser <button> styles.
@include dt-interactive-reset();
// Make anchors render like buttons.
display: inline-block;
white-space: nowrap;
text-decoration: none;
text-align: center;
overflow: hidden;
vertical-align: middle;
height: 32px;
border-style: solid;
border-radius: 3px;
border-width: 1px;
padding-top: 0;
padding-bottom: 0;
padding-left: 15px;
padding-right: 15px;
line-height: -moz-block-height;
background: transparent;
}
.dt-button {
box-sizing: border-box;
position: relative;
// Reset browser <button> styles.
// Make anchors render like buttons.
display: inline-block;
white-space: nowrap;
text-decoration: none;
text-align: center;
overflow: hidden;
vertical-align: middle;
height: 32px;
border-style: solid;
border-radius: 3px;
border-width: 1px;
padding-top: 0;
padding-bottom: 0;
padding-left: 15px;
padding-right: 15px;
line-height: -moz-block-height;
background: transparent;
}
@include main-font(30px);
@include dt-interactive-reset();
Always reset browser defaults
Re-define inheritable properties per
component
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Your component
Never assume any type
<dt-card headline=“It is beautiful”>
</dt-card>
<dt-card headline=“It is beautiful”>
</dt-card>
Cool! Can you make it bold?
<dt-card headline=“It is beautiful”>
</dt-card>
.headline {
font-weight: bold
}
<dt-card headline=“It is beautiful”>
</dt-card>
.headline {
font-weight: bold
}
<dt-card headline=“It is beautiful”>
</dt-card>
.headline {
font-weight: bold
}
No, I meant: Can you
make 

it bold?
!
<dt-card>
<dt-headline>
<strong>It is bold</strong>
</dt-headline>
</dt-card>
<div class="dt-card-header">
<div class="dt-card-heading">
<ng-content select=“dt-headline"></ng-content>
</div>
<ng-content></ng-content>
</div>
Content projection is your friend
View encapsulation
It's "just" a string - Learnings from building a component library 
Design-first vs. Code-first
Design-first
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Barista
Design System
UX + design Angular
component lib
Barista
Design System
UX + design Angular
component lib
Barista
Design System
UX + design Angular
component lib
Real-world component libraries at scale
Real-world component libraries at scale
Code-first
Code-first
Real-world component libraries at scale
Real-world component libraries at scale
Barista
Design System
UX + design Angular
component lib
Barista
Design System
UX + design Angular
component lib
Barista
Design System
UX + design Angular
component lib
Real-world component libraries at scale
Real-world component libraries at scale
Real-world component libraries at scale
Design vs. Code-first
…it depends
Design-first
Code-first
Real-world component libraries at scale
Real-world component libraries at scale
Behaviour and style go together
Code defensively
Katrin Freihofner

@Ka_TriN_F
Stefan Baumgartner

@ddprrt
Office hours

14:15
1 of 103

Recommended

IML 140 Design - Basics by
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - BasicsEvan Hughes
462 views44 slides
OK Flutter, Welcome to All platform era by
OK Flutter, Welcome to All platform eraOK Flutter, Welcome to All platform era
OK Flutter, Welcome to All platform eraTeerasej Jiraphatchandej
353 views47 slides
Una web todos los dispositivos. by
Una web todos los dispositivos.Una web todos los dispositivos.
Una web todos los dispositivos.philogb
950 views54 slides
Developing HTML5 apps for TV by
Developing HTML5 apps for TVDeveloping HTML5 apps for TV
Developing HTML5 apps for TVgerbille
3.8K views33 slides
Widgets are fun! sometimes.. by
Widgets are fun! sometimes..Widgets are fun! sometimes..
Widgets are fun! sometimes..Jesse Thomas
1.5K views13 slides
SharePoint Bootstrap 2013 by
SharePoint Bootstrap 2013SharePoint Bootstrap 2013
SharePoint Bootstrap 2013Vinod Dangudubiyyapu
176 views7 slides

More Related Content

Similar to Real-world component libraries at scale

Design System Ops by
Design System OpsDesign System Ops
Design System OpsQvik
2.1K views29 slides
Webtech File.docx by
Webtech File.docxWebtech File.docx
Webtech File.docxgambleryeager
1 view17 slides
Making your site printable: WordCamp Buffalo 2013 by
Making your site printable: WordCamp Buffalo 2013Making your site printable: WordCamp Buffalo 2013
Making your site printable: WordCamp Buffalo 2013Adrian Roselli
4.8K views69 slides
Prototyping w/HTML5 and CSS3 by
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Todd Zaki Warfel
5.1K views51 slides
Corilennyg gmail-com-rsp2 by
Corilennyg gmail-com-rsp2Corilennyg gmail-com-rsp2
Corilennyg gmail-com-rsp2cori0506
568 views36 slides
body{ font-family Arial, Times, sens-serif, helvetica; by
body{    font-family Arial, Times, sens-serif, helvetica;  body{    font-family Arial, Times, sens-serif, helvetica;
body{ font-family Arial, Times, sens-serif, helvetica; JeniceStuckeyoo
2 views16 slides

Similar to Real-world component libraries at scale(20)

Design System Ops by Qvik
Design System OpsDesign System Ops
Design System Ops
Qvik2.1K views
Making your site printable: WordCamp Buffalo 2013 by Adrian Roselli
Making your site printable: WordCamp Buffalo 2013Making your site printable: WordCamp Buffalo 2013
Making your site printable: WordCamp Buffalo 2013
Adrian Roselli4.8K views
Corilennyg gmail-com-rsp2 by cori0506
Corilennyg gmail-com-rsp2Corilennyg gmail-com-rsp2
Corilennyg gmail-com-rsp2
cori0506568 views
body{ font-family Arial, Times, sens-serif, helvetica; by JeniceStuckeyoo
body{    font-family Arial, Times, sens-serif, helvetica;  body{    font-family Arial, Times, sens-serif, helvetica;
body{ font-family Arial, Times, sens-serif, helvetica;
JeniceStuckeyoo2 views
Designing and Developing Windowed Interfaces for Web Apps by Steve Smith
Designing and Developing Windowed Interfaces for Web AppsDesigning and Developing Windowed Interfaces for Web Apps
Designing and Developing Windowed Interfaces for Web Apps
Steve Smith2.6K views
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co... by dezyneecole
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
dezyneecole2.2K views
Introduction to Shiny for building web apps in R by Paul Richards
Introduction to Shiny for building web apps in RIntroduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in R
Paul Richards10.5K views
Metro Wi B Product Overview 11 09 by irobbin2
Metro Wi B Product Overview 11 09Metro Wi B Product Overview 11 09
Metro Wi B Product Overview 11 09
irobbin2223 views
DG Group - Active Or Passive Website by Franco De Bonis
DG Group - Active Or Passive WebsiteDG Group - Active Or Passive Website
DG Group - Active Or Passive Website
Franco De Bonis1K views
Twitter Bootstrap by darbyfrey
Twitter BootstrapTwitter Bootstrap
Twitter Bootstrap
darbyfrey2K views
Twitter Bootstrap (spring) by darbyfrey
Twitter Bootstrap (spring)Twitter Bootstrap (spring)
Twitter Bootstrap (spring)
darbyfrey1.8K views
Google I/O 2018 Extended, Baghdad - Flutter by AbdElmomenKadhim
Google I/O 2018 Extended, Baghdad  - FlutterGoogle I/O 2018 Extended, Baghdad  - Flutter
Google I/O 2018 Extended, Baghdad - Flutter
AbdElmomenKadhim322 views

More from Stefan Baumgartner

WASM! WASI! WAGI! WAT? by
WASM! WASI! WAGI! WAT?WASM! WASI! WAGI! WAT?
WASM! WASI! WAGI! WAT?Stefan Baumgartner
530 views74 slides
Serverless Rust by
Serverless RustServerless Rust
Serverless RustStefan Baumgartner
389 views54 slides
What TypeScript taught me about JavaScript by
What TypeScript taught me about JavaScriptWhat TypeScript taught me about JavaScript
What TypeScript taught me about JavaScriptStefan Baumgartner
98 views28 slides
Jamstack on Azure by
Jamstack on AzureJamstack on Azure
Jamstack on AzureStefan Baumgartner
1.1K views55 slides
TypeScript's Type System by
TypeScript's Type SystemTypeScript's Type System
TypeScript's Type SystemStefan Baumgartner
222 views53 slides
The hero's journey by
The hero's journeyThe hero's journey
The hero's journeyStefan Baumgartner
276 views64 slides

Recently uploaded

Future of Learning - Yap Aye Wee.pdf by
Future of Learning - Yap Aye Wee.pdfFuture of Learning - Yap Aye Wee.pdf
Future of Learning - Yap Aye Wee.pdfNUS-ISS
38 views11 slides
ChatGPT and AI for Web Developers by
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web DevelopersMaximiliano Firtman
174 views82 slides
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...Vadym Kazulkin
70 views64 slides
AI: mind, matter, meaning, metaphors, being, becoming, life values by
AI: mind, matter, meaning, metaphors, being, becoming, life valuesAI: mind, matter, meaning, metaphors, being, becoming, life values
AI: mind, matter, meaning, metaphors, being, becoming, life valuesTwain Liu 刘秋艳
34 views16 slides
handbook for web 3 adoption.pdf by
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdfLiveplex
19 views16 slides
Combining Orchestration and Choreography for a Clean Architecture by
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean ArchitectureThomasHeinrichs1
68 views24 slides

Recently uploaded(20)

Future of Learning - Yap Aye Wee.pdf by NUS-ISS
Future of Learning - Yap Aye Wee.pdfFuture of Learning - Yap Aye Wee.pdf
Future of Learning - Yap Aye Wee.pdf
NUS-ISS38 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin70 views
AI: mind, matter, meaning, metaphors, being, becoming, life values by Twain Liu 刘秋艳
AI: mind, matter, meaning, metaphors, being, becoming, life valuesAI: mind, matter, meaning, metaphors, being, becoming, life values
AI: mind, matter, meaning, metaphors, being, becoming, life values
handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex19 views
Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291614 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb12 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma17 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10165 views
[2023] Putting the R! in R&D.pdf by Eleanor McHugh
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh38 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta14 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman25 views
How the World's Leading Independent Automotive Distributor is Reinventing Its... by NUS-ISS
How the World's Leading Independent Automotive Distributor is Reinventing Its...How the World's Leading Independent Automotive Distributor is Reinventing Its...
How the World's Leading Independent Automotive Distributor is Reinventing Its...
NUS-ISS15 views
The Importance of Cybersecurity for Digital Transformation by NUS-ISS
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital Transformation
NUS-ISS25 views
RADIUS-Omnichannel Interaction System by RADIUS
RADIUS-Omnichannel Interaction SystemRADIUS-Omnichannel Interaction System
RADIUS-Omnichannel Interaction System
RADIUS14 views

Real-world component libraries at scale