SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
Bringing a Design Language to Life
Grace Kwan, Senior UX Engineer @ Button
• Senior UX Engineer at Button, a mobile commerce startup in NYC
• I design & develop for the web, with a focus on design systems
• @gckwan on Medium / grace@usebutton.com
About Me
What is a Design Language?
• A system that emphasizes the meaning of design elements
• Core styles
• UI components
• Patterns
• Analogy: Words, phrases, grammar
Like any other language – a way of communicating in according to clear, consistent, meaningful rules. 

- Core styles – some call them “design elements.” These are like words, in that each individual element has meaning. (colors, typography, spacing)

- UI components, such as inputs, buttons, and containers built on top of those core styles. These are like phrases.
- Patterns define the correct usage of UI components. They’re like grammar, in that unless phrases are strung together in the correct order, they’ll sound odd.
Core Styles: Colors
UI Components
UI Components

Combine core styles to communicate with the user. For example, you can see how the colors and text combine in the case of the FeatureAlert to indicate whether the
message is purely informational or indicates a good/bad thing.

This also crosses over into patterns. An established pattern is that if you see a question mark icon, you can hover over it to view a tooltip. This is the “grammar” of our
design language, and if it doesn’t work, we’re violating it – and we’re failing to communicate with the user.
Why Invest in a Design Language?
• Design & build UI faster
• Communicate consistently, regardless of the designer/developer
• Set the foundation for future evolutions
…regardless of the individual designer
For web development:For design: For communication:
React UI LibrarySketch UI Library A style guide
How might we make a design language easy to speak?
For web development:For design: For communication:
React UI LibrarySketch UI Library A style guide
How might we make a design language easy to speak?
First, we’ll discuss the Sketch UI Lib.
Sketch Symbols
• An easy way to reuse elements across Sketch files
• Master is stored in the document’s Symbols Page
• Each use of the symbol is an instance
• Instances can have overrides, such as text
Designing Scalable Symbols
• Naming: [Element] / [Variant]
• Resizing: Pin to edge, Fix Width, Fix Height
• Color Masks: Create symbols with a number of color options
• Symbol Organizer: Neatly organize your symbols page by name
There are a few things you’ll want to keep in mind when turning your UI comps into Sketch. In particular, here are a few tips and tricks.
Naming:
[element] / [variant]
Resizing
Resizing
Color Masks
Symbol Organizer
Sketch Libraries
• Symbols page shared across multiple Sketch documents
• Each document can individually subscribe to updates
• Any Sketch document can be a library
Symbols are definitely handy, but until now, they’ve been limited only to single Sketch documents. As of Sketch 47, Sketch now officially supports libraries, which makes
it much easier to maintain consistent styles across documents.
Structuring Your Libraries
• One Sketch Library for Core Styles, one for UI Components
• Separate libraries for any company-specific assets
• Abstract for version control
1. This allows the UI components library to build on top of and use the core styles

2. Dropbox for automatic backup and syncing across people; Abstract does the same but builds in version management.
For web development:For design: For communication:
React UI LibrarySketch UI Library A style guide
How might we make a design language easy to speak?
Core Styles in CSS
• One variable for each CSS rule
• One class for each “exported” core style
• Ensure styles are scoped appropriately (can use CSS Modules)
First, I’ll talk about our core styles and how we represent them in our library in CSS.

Here at Button, we use SCSS and CSS Modules to make styling easier. SCSS gives us variables, mixins, and other handy language extensions, whereas CSS Modules
solves CSS’s classic global scoping problem, so we can ensure that our UI library styles never bleed into or override the application’s local styles. 

However, what we discuss here should be applicable even if you don’t use this exact setup.
Variables on the left

Helper classes (Denoted by underscore)

External-facing classes, for direct use in JSX
Building React UI Components
• Strictly presentational components
• Use props to represent all possible variants
• Avoid overriding individual instances in CSS
• Enums/utils for shared logic across components
How to write a React component is out of scope, but this is a good starting point

“Keep it open-sourceable”
className is generally only used for spacing

Note the status enum and helpers (getAlertIconType and getAlertColor, which simply return a string for the icon type name and the icon color to pass to the Icon
component)
Structuring a UI Library in code
• Standalone GitHub repository
• Export core styles, UI components
• Avoid unnecessary dependencies
• Semantic versioning (major, minor, & patch versions)
Semver: Each repo can subscribe to updates on its own, much like Sketch libraries
For web development:For design: For communication:
React UI LibrarySketch UI Library A style guide
How might we make a design language easy to speak?
What is a Style Guide?
• The what, how, and why of your design language
• Use cases for each core style & component
• A single source of truth across teams
React Storybook
• Generate an interactive style guide using simple “story” syntax
• Component playgrounds
• Handy plugins
Still a work in progress

Filling out overviews
How Do I Get Started?
• Review your existing UIs + select the elements to keep
• Document use cases and patterns as you go
• React-sketchapp: Render React & Sketch components from React Native code
So far we’ve focused our efforts on web, because we’re still a tiny company
Want to work on problems like these?
Button is hiring!
Shoot me a line at grace@usebutton.com.

Mais conteúdo relacionado

Semelhante a Bringing a Design Language to Life in Sketch and React

Programming Languages #devcon2013
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013
Iván Montes
 
Getty Presentation of IMA/AIC OSCI tool
Getty Presentation of IMA/AIC OSCI toolGetty Presentation of IMA/AIC OSCI tool
Getty Presentation of IMA/AIC OSCI tool
Robert J. Stein
 
Presentation of the AIC-IMA publishing tool for OSCI
Presentation of the AIC-IMA publishing tool for OSCIPresentation of the AIC-IMA publishing tool for OSCI
Presentation of the AIC-IMA publishing tool for OSCI
Robert J. Stein
 

Semelhante a Bringing a Design Language to Life in Sketch and React (20)

Do Icons Aid The User Experience
Do Icons Aid The User ExperienceDo Icons Aid The User Experience
Do Icons Aid The User Experience
 
Open Source Design Pattern Library, Spreading Communities Thick: Open Source ...
Open Source Design Pattern Library, Spreading Communities Thick: Open Source ...Open Source Design Pattern Library, Spreading Communities Thick: Open Source ...
Open Source Design Pattern Library, Spreading Communities Thick: Open Source ...
 
SDA-lecture-F5.pptx
SDA-lecture-F5.pptxSDA-lecture-F5.pptx
SDA-lecture-F5.pptx
 
New voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developerNew voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developer
 
Building & Scaling a Front End Practice & Team
Building & Scaling a Front End Practice & TeamBuilding & Scaling a Front End Practice & Team
Building & Scaling a Front End Practice & Team
 
web_dev_first_session.pptx
web_dev_first_session.pptxweb_dev_first_session.pptx
web_dev_first_session.pptx
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 Flex
 
Creating Style Guides with Modularity in Mind
Creating Style Guides with Modularity in MindCreating Style Guides with Modularity in Mind
Creating Style Guides with Modularity in Mind
 
APIs at Scale with TypeSpec by Mandy Whaley, Microsoft
APIs at Scale with TypeSpec by Mandy Whaley, MicrosoftAPIs at Scale with TypeSpec by Mandy Whaley, Microsoft
APIs at Scale with TypeSpec by Mandy Whaley, Microsoft
 
Low-Cost Digital Marketing Service in Nagpur | PSK Technologies
Low-Cost Digital Marketing Service in Nagpur | PSK TechnologiesLow-Cost Digital Marketing Service in Nagpur | PSK Technologies
Low-Cost Digital Marketing Service in Nagpur | PSK Technologies
 
PPT ON UI.pptx
PPT ON UI.pptxPPT ON UI.pptx
PPT ON UI.pptx
 
Web Design & Development Courses in Pune |Web Development Classes in Pune | ...
Web Design & Development Courses  in Pune |Web Development Classes in Pune | ...Web Design & Development Courses  in Pune |Web Development Classes in Pune | ...
Web Design & Development Courses in Pune |Web Development Classes in Pune | ...
 
이번 생에 디자인 시스템은 처음이라
이번 생에 디자인 시스템은 처음이라이번 생에 디자인 시스템은 처음이라
이번 생에 디자인 시스템은 처음이라
 
Design Systems: Enterprise UX Evolution
Design Systems: Enterprise UX EvolutionDesign Systems: Enterprise UX Evolution
Design Systems: Enterprise UX Evolution
 
CORE content: An omnichannel-first approach
CORE content: An omnichannel-first approachCORE content: An omnichannel-first approach
CORE content: An omnichannel-first approach
 
Programming Languages #devcon2013
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013
 
An introduction to Sketch
An introduction to SketchAn introduction to Sketch
An introduction to Sketch
 
Getty Presentation of IMA/AIC OSCI tool
Getty Presentation of IMA/AIC OSCI toolGetty Presentation of IMA/AIC OSCI tool
Getty Presentation of IMA/AIC OSCI tool
 
Presentation of the AIC-IMA publishing tool for OSCI
Presentation of the AIC-IMA publishing tool for OSCIPresentation of the AIC-IMA publishing tool for OSCI
Presentation of the AIC-IMA publishing tool for OSCI
 
Jan 8 2014 NISO Webinar: Device to Device: Adaptive Interfaces for Content
Jan 8 2014 NISO Webinar: Device to Device: Adaptive Interfaces for ContentJan 8 2014 NISO Webinar: Device to Device: Adaptive Interfaces for Content
Jan 8 2014 NISO Webinar: Device to Device: Adaptive Interfaces for Content
 

Último

Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
instagramfab782445
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
tbatkhuu1
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
gajnagarg
 
👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...
👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...
👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...
karishmasinghjnh
 
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
eeanqy
 
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
amitlee9823
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
amitlee9823
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
saipriyacoool
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
kumaririma588
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 

Último (20)

Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
 
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
 
👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...
👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...
👉 Call Girls Service Amritsar 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Agen...
 
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best ServiceHigh Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
 
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls AgencyHire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRLHingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 

Bringing a Design Language to Life in Sketch and React

  • 1. Bringing a Design Language to Life Grace Kwan, Senior UX Engineer @ Button
  • 2. • Senior UX Engineer at Button, a mobile commerce startup in NYC • I design & develop for the web, with a focus on design systems • @gckwan on Medium / grace@usebutton.com About Me
  • 3. What is a Design Language? • A system that emphasizes the meaning of design elements • Core styles • UI components • Patterns • Analogy: Words, phrases, grammar Like any other language – a way of communicating in according to clear, consistent, meaningful rules. - Core styles – some call them “design elements.” These are like words, in that each individual element has meaning. (colors, typography, spacing) - UI components, such as inputs, buttons, and containers built on top of those core styles. These are like phrases. - Patterns define the correct usage of UI components. They’re like grammar, in that unless phrases are strung together in the correct order, they’ll sound odd.
  • 5. UI Components UI Components Combine core styles to communicate with the user. For example, you can see how the colors and text combine in the case of the FeatureAlert to indicate whether the message is purely informational or indicates a good/bad thing. This also crosses over into patterns. An established pattern is that if you see a question mark icon, you can hover over it to view a tooltip. This is the “grammar” of our design language, and if it doesn’t work, we’re violating it – and we’re failing to communicate with the user.
  • 6. Why Invest in a Design Language? • Design & build UI faster • Communicate consistently, regardless of the designer/developer • Set the foundation for future evolutions …regardless of the individual designer
  • 7. For web development:For design: For communication: React UI LibrarySketch UI Library A style guide How might we make a design language easy to speak?
  • 8. For web development:For design: For communication: React UI LibrarySketch UI Library A style guide How might we make a design language easy to speak? First, we’ll discuss the Sketch UI Lib.
  • 9. Sketch Symbols • An easy way to reuse elements across Sketch files • Master is stored in the document’s Symbols Page • Each use of the symbol is an instance • Instances can have overrides, such as text
  • 10.
  • 11. Designing Scalable Symbols • Naming: [Element] / [Variant] • Resizing: Pin to edge, Fix Width, Fix Height • Color Masks: Create symbols with a number of color options • Symbol Organizer: Neatly organize your symbols page by name There are a few things you’ll want to keep in mind when turning your UI comps into Sketch. In particular, here are a few tips and tricks.
  • 13.
  • 17.
  • 19.
  • 20. Sketch Libraries • Symbols page shared across multiple Sketch documents • Each document can individually subscribe to updates • Any Sketch document can be a library Symbols are definitely handy, but until now, they’ve been limited only to single Sketch documents. As of Sketch 47, Sketch now officially supports libraries, which makes it much easier to maintain consistent styles across documents.
  • 21.
  • 22. Structuring Your Libraries • One Sketch Library for Core Styles, one for UI Components • Separate libraries for any company-specific assets • Abstract for version control 1. This allows the UI components library to build on top of and use the core styles 2. Dropbox for automatic backup and syncing across people; Abstract does the same but builds in version management.
  • 23. For web development:For design: For communication: React UI LibrarySketch UI Library A style guide How might we make a design language easy to speak?
  • 24. Core Styles in CSS • One variable for each CSS rule • One class for each “exported” core style • Ensure styles are scoped appropriately (can use CSS Modules) First, I’ll talk about our core styles and how we represent them in our library in CSS. Here at Button, we use SCSS and CSS Modules to make styling easier. SCSS gives us variables, mixins, and other handy language extensions, whereas CSS Modules solves CSS’s classic global scoping problem, so we can ensure that our UI library styles never bleed into or override the application’s local styles. However, what we discuss here should be applicable even if you don’t use this exact setup.
  • 25. Variables on the left Helper classes (Denoted by underscore) External-facing classes, for direct use in JSX
  • 26. Building React UI Components • Strictly presentational components • Use props to represent all possible variants • Avoid overriding individual instances in CSS • Enums/utils for shared logic across components How to write a React component is out of scope, but this is a good starting point “Keep it open-sourceable”
  • 27. className is generally only used for spacing Note the status enum and helpers (getAlertIconType and getAlertColor, which simply return a string for the icon type name and the icon color to pass to the Icon component)
  • 28. Structuring a UI Library in code • Standalone GitHub repository • Export core styles, UI components • Avoid unnecessary dependencies • Semantic versioning (major, minor, & patch versions) Semver: Each repo can subscribe to updates on its own, much like Sketch libraries
  • 29. For web development:For design: For communication: React UI LibrarySketch UI Library A style guide How might we make a design language easy to speak?
  • 30. What is a Style Guide? • The what, how, and why of your design language • Use cases for each core style & component • A single source of truth across teams
  • 31. React Storybook • Generate an interactive style guide using simple “story” syntax • Component playgrounds • Handy plugins
  • 32. Still a work in progress Filling out overviews
  • 33. How Do I Get Started? • Review your existing UIs + select the elements to keep • Document use cases and patterns as you go • React-sketchapp: Render React & Sketch components from React Native code So far we’ve focused our efforts on web, because we’re still a tiny company
  • 34. Want to work on problems like these? Button is hiring! Shoot me a line at grace@usebutton.com.