SlideShare a Scribd company logo
Secretsofbuildingrobust
UIcomponents
@glnnrys
Glenn Reyes - Secrets of building robust UI components
GlennReyes
Independent Software Engineer
React, GraphQL, Design Systems & TypeScript
@glnnrys
BuildingUIs
BuildingUIs
isfun
BuildingrobustUIs
ishard
BuildingrobustUIs
ishard
Whatisrobust?
Glenn Reyes - Secrets of building robust UI components
🧐
Stable
Reliable
Functioneffectivelyandreliablyundera
widerangeofconditions
ConsistentUX Performance
WhatmakesrobustUIs
Stepsofbuildingnewuserinterfaces
Tooling Theming Building
Tooling
=
Bettertooling BetterDX
Bettertooling
keepsyourcodebaseclean
Bettertooling
Keepsyourcodebaseclean
withoutthehassle
Glenn Reyes - Secrets of building robust UI components
Findandfixproblemsinthecode
withnoeffort
Preferdeterministiccodestyle
AutoSorting
Deterministiccodemakescode
morereliable,predictableandconsistent
✨ Separate config files per app
✅ Client: eslint-config-banana/react
✅ Server: eslint-config-banana/node
✅ Anything: eslint-config-banana (core)
✨ Enhance linting with type information
✅ More options for improved DX
ESLint
pnpm add eslint-config-banana —-dev
Prettier
@trivago/prettier-plugin-sort-imports prettier-plugin-tailwindcss
Buildcomponentsinisolation
Buildcomponentsin
isolation
with component explorers
Storybook
Styleguidist
Bit
React Cosmos
Wix Component Studio
Runautomatedtests
forUIcomponents
100%UIstatecoverageiskey
Theming
StephenHay
“We’re not designing pages,
we’re designing systems of
components.”
Designtokens
Typography Color Spacing
Designtokens
Typography
Color
Spacing
Designtokens
Download
Color
Spacings
Typography
Componentsfor
Layout&Spacing
BuildingrobustUIs
Loremipsumdolorsitametconsecteturadipisicingelit.
Unde,doloremquemodi?Facere,aperiam.Obcaecati
laboriosam,laborumeiusvoluptatumquasieaque
maximeconsequuntur,facilisnumquamsitex,
praesentiumtempora architectoquibusdam.
Loremipsumdolorsitametconsecteturadipisicingelit.
Unde,doloremquemodi?Facere,aperiam.Obcaecati
laboriosam,laborumeiusvoluptatumquasieaque
maximeconsequuntur,facilisnumquamsitex,
praesentiumtempora architectoquibusdam.
Loremipsumdolorsitametconsecteturadipisicingelit.
Unde,doloremquemodi?Facere,aperiam.Obcaecati
laboriosam,laborumeiusvoluptatumquasieaque
maximeconsequuntur,facilisnumquamsitex,
praesentiumtempora architectoquibusdam.
Loremipsumdolorsitametconsecteturadipisicingelit.
Unde,doloremquemodi?Facere,aperiam.Obcaecati
laboriosam,laborumeiusvoluptatumquasieaque
maximeconsequuntur,facilisnumquamsitex,
praesentiumtempora architectoquibusdam.
BuildingrobustUIs
Loremipsum dolorsitametconsecteturadipisicingelit.
Unde,doloremquemodi?Facere,aperiam.Obcaecati
laboriosam,laborumeiusvoluptatumquasieaque
maximeconsequuntur,facilisnumquamsitex,
praesentium temporaarchitectoquibusdam.
Loremipsum dolorsitametconsecteturadipisicingelit.
Unde,doloremquemodi?Facere,aperiam.Obcaecati
laboriosam,laborumeiusvoluptatumquasieaque
maximeconsequuntur,facilisnumquamsitex,
praesentium temporaarchitectoquibusdam.
gap: 24px
BuildingrobustUIs
Building
Atomicdesign
https://bradfrost.com/blog/post/atomic-web-design
The most basic building blocks
Atoms
Button Input Select
Card
Icon
Divider
Body Text
Heading
Checkbox
A composition of atoms in its smallest fundamental unit
Molecules
Search
Search this site
Groups of molecules joined together
Organisms
Search
Search this site
Home Articles About Contact
Consist mostly of groups of organisms stitched together to form pages
Templates
Search
Search this site
Home Articles About Contact
Speci
fi
c instances of templates with real representative content
Pages
Search
Search this site
Home Articles About Contact
My thoughts on this conference
ComponentDrivenDevelopment
Buildfromthebottomup
Search
Search
Buildfromthe
bottomup
Code
Glenn Reyes - Secrets of building robust UI components
✅ Try keep separate dumb & smart components
✅ Group related code parts together
✅ Build custom hooks if applicable
✅ Reduce the API surface to the bare minimum
Quickwins
ReactComponentProps
<Button primary />
<Button primary secondary />
<Button primary secondary />
Glenn Reyes - Secrets of building robust UI components
<Button appearance="primary" />
Glenn Reyes - Secrets of building robust UI components
Booleantypevs.Uniontype
<PrimaryButton />
<SecondaryButton />
<PrimaryButton />
<Button appearance="primary" />
<Button primary />
vs.
vs.
TypesforHTMLelementattributes
😓 😓
🤨 🤨
🤓 🤓
🤩 🤩
BanclassNameandstylein
UIcomponents
BanclassNameandstylein
UIcomponents
Reuseexisting
typesandinterfaces
Reuseexisting
typesandinterfaces
Glenn Reyes - Secrets of building robust UI components
Glenn Reyes - Secrets of building robust UI components
CompoundComponents
Polymorphiccomponents
Polymorphiccomponents
Glenn Reyes - Secrets of building robust UI components
GenericsinReactUIcomponents
Component Usage
GenericsinReactUIcomponents
Overloadfunctioncomponents
Overloadfunctioncomponents
typevsinterface
inReactcomponentprops
typevsinterface
inReactcomponentprops
Reducedcomputationalwork
byusinginterface
Encourage type annotations.
Especially return types.
helps with faster compilation
https://github.com/microsoft/TypeScript/wiki/Performance
MoreTypeScriptthings
tohelp avoid badtypes
🚩 any → ✅ parse (eg. with zod)
🚩 Type assertions → ✅ Narrow type instead
MoreTypeScriptthings
tohelp avoid badtypes
MoreTypeScriptthings
tohelp avoid badtypes
🚩 Non-null assertions → ✅ Narrow type instead
Glenn Reyes - Secrets of building robust UI components
Glenn Reyes - Secrets of building robust UI components
Glenn Reyes - Secrets of building robust UI components
Takeaways
Propertooling
encouragesrobustcode.
Aresilientdesignsystem
encouragesrobustcode.
Stricttypes
encouragesrobustcode.
Stricttypesencourages
robustUIcomponents.
ThekeytorobustUIis
simplicity.
UIcomponentsshouldbe
reusable.
Take good care
from the ground up.
Saves tons of headache later.
¡Gracias!
Glenn Reyes · @glnnrys ·glennreyes.com
https://speakerdeck.com/glennreyes/secrets-of-building-robust-ui-components

More Related Content

DOCX
Resume_A_Vinod
DOCX
Resume: DevOps/Technology Architect - Satya Prakash
PDF
Pipeline as code for your infrastructure as Code
PDF
Dinu Baby CV 6Y.pdf
PDF
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
PDF
Dinu Baby 7Y CV.pdf
PDF
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
PDF
Resume ram-krishna
Resume_A_Vinod
Resume: DevOps/Technology Architect - Satya Prakash
Pipeline as code for your infrastructure as Code
Dinu Baby CV 6Y.pdf
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Dinu Baby 7Y CV.pdf
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
Resume ram-krishna

Similar to Glenn Reyes - Secrets of building robust UI components (20)

PPTX
Build 2019 Recap
PDF
Dinu Baby CV.pdf
PDF
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
PDF
Sexy React Stack
PDF
OrangeScape Cool Facts That You Did Not Know!!!
PPTX
ATAGTR2017 Protractor Cucumber BDD Approach
PDF
James Turner (Caplin) - Enterprise HTML5 Patterns
PPTX
Gapand 2017 - Diseñando Arquitecturas Serverless en Azure
PDF
technetry Broucher.pdf
PDF
Evolving Mobile Architectures
DOCX
CURRICULUM VITAE
PDF
Scaling DevSecOps Culture for Enterprise
PPTX
CWIN17 Toulouse / Safe 4.5 and agile devops-ca technologies-r.bajul
DOC
Vijay_Teekinavar_Kallesh
PDF
Consistent Development Environment with Vagrant and Chef
PDF
de:code 2019 DT06 vs-show どっちのVSショー
PDF
Life as a SRE at Instana
PDF
Application Experience Analytics Services: The Strategic Digital Transformati...
PDF
Mainframe as a Service: Sample a Buffet of IBM z/OS® Platform Excellence
DOCX
Bhavin_Resume
Build 2019 Recap
Dinu Baby CV.pdf
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
Sexy React Stack
OrangeScape Cool Facts That You Did Not Know!!!
ATAGTR2017 Protractor Cucumber BDD Approach
James Turner (Caplin) - Enterprise HTML5 Patterns
Gapand 2017 - Diseñando Arquitecturas Serverless en Azure
technetry Broucher.pdf
Evolving Mobile Architectures
CURRICULUM VITAE
Scaling DevSecOps Culture for Enterprise
CWIN17 Toulouse / Safe 4.5 and agile devops-ca technologies-r.bajul
Vijay_Teekinavar_Kallesh
Consistent Development Environment with Vagrant and Chef
de:code 2019 DT06 vs-show どっちのVSショー
Life as a SRE at Instana
Application Experience Analytics Services: The Strategic Digital Transformati...
Mainframe as a Service: Sample a Buffet of IBM z/OS® Platform Excellence
Bhavin_Resume
Ad

More from Wey Wey Web (20)

PDF
Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natali...
PDF
Auditing Design Systems for Accessibility - Anna E. Cook
PDF
Adaptive Designs, Beyond Pixel Perfection - Stephanie Walter
PDF
Sharing is caring: what to know before you build a Research Repository - Juli...
PDF
Unlocking collaboration: A framework for developers and designers - Alicia Ca...
PDF
3 reasons to switch to OKLCH - Anton Lovchikov
PDF
ChatGPT and AI for web developers - Maximiliano Firtman
PDF
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
PDF
Form follows emotion - Isabella De Cuppis
PPTX
UX for emerging tech - Josephine Scholtes
PDF
Collaborative software with State Machines - Laura Kalbag
PDF
Lessons Learned from building Session Replay - Francesco Novy
PDF
Let's get visual. Visual testing in your project - Ramona Schwering
PDF
Solving Common Web Component Problems - Simon MacDonald
PDF
The Future is Malleable - Aleksandra Sikora
PDF
Trending tools & methodologies for UX - Josephine Scholtes.pdf
PDF
Decoding Web Accessibility through Testing - Anuradha Kumari
PDF
Good Security is one question away - Wiktoria Dalach
PDF
Dynamic CSS Secrets - Lea Verou
PDF
The Misty Report - Douglas Crockford
Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natali...
Auditing Design Systems for Accessibility - Anna E. Cook
Adaptive Designs, Beyond Pixel Perfection - Stephanie Walter
Sharing is caring: what to know before you build a Research Repository - Juli...
Unlocking collaboration: A framework for developers and designers - Alicia Ca...
3 reasons to switch to OKLCH - Anton Lovchikov
ChatGPT and AI for web developers - Maximiliano Firtman
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Form follows emotion - Isabella De Cuppis
UX for emerging tech - Josephine Scholtes
Collaborative software with State Machines - Laura Kalbag
Lessons Learned from building Session Replay - Francesco Novy
Let's get visual. Visual testing in your project - Ramona Schwering
Solving Common Web Component Problems - Simon MacDonald
The Future is Malleable - Aleksandra Sikora
Trending tools & methodologies for UX - Josephine Scholtes.pdf
Decoding Web Accessibility through Testing - Anuradha Kumari
Good Security is one question away - Wiktoria Dalach
Dynamic CSS Secrets - Lea Verou
The Misty Report - Douglas Crockford
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation theory and applications.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
cuic standard and advanced reporting.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectroscopy.pptx food analysis technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Digital-Transformation-Roadmap-for-Companies.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

Glenn Reyes - Secrets of building robust UI components