Innovate with React

Rate this content
Bookmark
Slides

In this workshop, you will learn how to create a Custom Component System from scratch in React, and take it to the next level.

You will learn best practices when building a Component System, as well as the tools that you can use to be a more effective collaborator with other cross-functional teams.


What's included

1. Introduction

2. Learn the fundamentals of a Component System

3. Setting up the development environment

4. Importing fonts

5. Choosing a base React Component Library

6. Writing our first components

7. Setting up a centralized theme

8. Writing custom styles to inject to our components

9. Injecting icons to our components

10. Adding hooks

11. Making components responsive

12. Adding dark mode

13. Deploying your Component System

14. Exporting your Component System to a design tool

15. Prototyping with your production components

FAQ

Anima is a prototyping tool that allows designers to convert design assets into code. It facilitates the creation of prototypes that resemble the final product by enabling the embedding of functional components directly from development environments like Storybook into design tools like Figma.

The integration allows for direct synchronization of component libraries from Storybook to Figma. This enables designers to use actual production components for high-fidelity prototyping, ensuring consistency between the designed prototype and the final product, and accelerating the design-to-development workflow.

The 'dark mode' feature in Storybook allows users to switch between light and dark visual themes for UI components. It is implemented by defining separate themes for 'light' and 'dark' modes in the Storybook configuration, which can be toggled by a user interface control within Storybook.

To deploy a Storybook instance to the web, you can build a static version of your Storybook using the build command and then deploy this static site to a hosting service like Netlify. This process involves generating a static output directory and then dragging and dropping this directory into Netlify's deployment interface.

Using responsive font sizes in Storybook helps ensure that typography adjusts appropriately across different screen sizes, enhancing the readability and accessibility of UI components on various devices. It's implemented using the 'responsive font sizes' utility which automatically adjusts font sizes based on the screen width.

Cristobal Chao
Cristobal Chao
156 min
29 Nov, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

A software developer named Cristobal Chao conducted a workshop on component-based development using React and Material UI. The workshop covered topics such as setting up the environment, organizing components, improving accessibility, styling with Emotion, and implementing dark mode. Participants learned how to install Storybook, use Material UI components, customize themes, and make components responsive. The workshop also touched on integrating components with Figma for prototyping and gaining user feedback.

Available in Español: Innovar con React

1. Introduction and Table of Contents

Short description:

Hello, everyone. My name is Cristobal Chao. I live in New York City, but you can probably notice an accent. I am from Spain originally. I came to the States 10 years ago. I live in San Francisco and now I live in New York, so closer and closer to Europe little by little. Let's just start. So here, probably you are already you have in front of you. The, the Table of Contents what I'm sharing with you right now. So what we can do is we have two types of navigation at this level.

Hello, everyone. My name is Cristobal Chao. I live in New York City, but you can probably notice an accent. I am from Spain originally. I came to the States 10 years ago. I live in San Francisco and now I live in New York, so closer and closer to Europe little by little.

Let's just start. So here, probably you are already you have in front of you. The, the Table of Contents what I'm sharing with you right now. So what we can do is we have two types of navigation at this level. One is you can click on any of these sections and then it will get you there, or you can click here on the top right corner in next to go to the next session. All right. We will be covering the introduction, just a little bit of intro. Then we will be doing the setting up the Dev environment, and we will have three sections of implementations where we will cover the very basics of implementing a design system in React. And then we will be adding more and more complexity to it. All right, at the very end, on level up, that's the part that we will be covering at the very, very end. But in any case is, the, I think is the most exciting part. Anyways, let's jump straight in. I know that there is a comment. All right, let me double check. Yep. And all right, it's time to go, guys.

2. Introduction and Environment Setup

Short description:

Introduction: A component system is a single source of truth that communicates the values, tone of voice, and guidelines of an application. It ensures consistency and cohesiveness, benefiting both users and developers. Next, we will set up the environment by installing the necessary packages and creating a new React app. I will guide you through the process, but please note that I may not be able to address all questions. After installing the app, we will open our IDE, clean up unnecessary files and dependencies, and ensure that the React app is still running.

So the introduction. Well, before I jump into this as well. If you guys get stuck at any given point, every single section except the introduction has the downloaded file at the very end. So imagine that you are on, not in this section, on the next one, on setting up the environment, and you get stuck somewhere here. You can always get the latest from this section at the very end. You have the link down here. All right. I know that you may get stuck. So you can always get back on track, all right.

Anyways, so introduction, guys. So what is a component system? So a lot of people have different opinions about what a component system is. But at the end of the day, it is a single source of truth, right? You have all the elements that are used across your application that pretty much communicates the values of your application, the tone of voice, the guidelines, right, the patterns. And it's not a finished product, right? Like we think sometimes that a component system is just the final product, but no, it's not. It's at the end of the day what the product is going to look like so things are more consistent, all right. Do you want to have a component system if you want to see if you want to get an app that is consistent and cohesive? So I think if you have a small company, you probably are not thinking about this. But at the end of the day, this will hurt you. And it will hurt you two ways. One way is from a user level, people will get confused like, where am I? And from a developer perspective, you are not efficiently getting the most out of it, because once you have a component system, you can reuse stuff. And people know what is the latest and greatest. So it's a greatest source of communication.

All right. We're going to jump into setting up the environment. Now, I have to say. I will be doing this with you. So we will be installing everything from scratch. I'm going to have this side by side by side. And if you guys again, if you guys have any questions, let me know. But I'm not going to be able to address all of them. All right. So I have my terminal on the right side. I have on the left side where you should be as well. And we will be installing the packages first. You can go one by one if you don't have NPX or if you don't have yarn. I will be using yarn. All right. But if you have it, if you have if you use NPM is fine. Just understand that any time that you see a command in yarn, you will need to translate that into NPM. All right. I think it's pretty straightforward. But in any case, we're going to do a create a new React app. I expect that all of you know what this is. There are links to the docs here, but I also have the snippet right there. Just copy this and paste it. If you don't have NPM, you need to install it on this first command right here. All right. I'm going to zoom this a little bit. Just in case if you don't see it well. Another thing while I'm installing this, I will be doing this in Visual Code. I think you can use any ID you want, but you may run into some issues with some of this stuff that I will be explaining. But we will cover that in a second. But the thing is, if you have Visual Studio, great. If you don't, best of luck. All right. I hope you will be able to get anywhere. But just in case, I'm just telling you this. We are installing a new React app from the very beginning. I'm doing this with yarn. If you have Visual Studio, you're going to start starting that now because we will get there in a second. All right. I don't see any questions. I hope you guys are not shy. All right. Cool. So we install our React app, and now we can just go to the next level, which is going to our new folder, and start in the server. I do yarn start. Again, if you're using npm, it will be npm run start. All right. We're getting new people coming. All right. Cool. So I just ran the app. I see it here. You probably are familiar with this. You have seen that before, I expect. Anyways, I'm going to come back to our presentation, our workshop, and the first thing we're going to do is we're going to open our IDE. In this case, I will be using Visual Studio, as I mentioned. And we're going to do some cleaning. All right? There are some files that we don't need. One of them is report vitals, and the other one are tests. All right? Tests are very important, guys. Don't get me wrong, but for this presentation, for this workshop, we don't need them. So I'm going to be removing those so things are a little bit cleaner, all right? So I'm going to be removing these files. Report web vitals, setup tests. All gone. If I go now to index JS, I will need to remove some of these files and some of these instances because we don't want them to be around, all right? On the package JSON, you can also remove some of the stuff that we don't need, like some of these dependencies on the top, we don't need them. But because we already install it, I mean, it's fine. Same with the web vitals, we can just remove that, all right? Cool, I'm going to zoom this a little bit so you can also see that, all right, fantastic. And I'm going to double-check that that React app is still running.

Watch more workshops on topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured WorkshopFree
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Concurrent Rendering Adventures in React 18
React Advanced Conference 2021React Advanced Conference 2021
132 min
Concurrent Rendering Adventures in React 18
Top Content
Featured WorkshopFree
Maurice de Beijer
Maurice de Beijer
With the release of React 18 we finally get the long awaited concurrent rendering. But how is that going to affect your application? What are the benefits of concurrent rendering in React? What do you need to do to switch to concurrent rendering when you upgrade to React 18? And what if you don’t want or can’t use concurrent rendering yet?

There are some behavior changes you need to be aware of! In this workshop we will cover all of those subjects and more.

Join me with your laptop in this interactive workshop. You will see how easy it is to switch to concurrent rendering in your React application. You will learn all about concurrent rendering, SuspenseList, the startTransition API and more.
React Hooks Tips Only the Pros Know
React Summit Remote Edition 2021React Summit Remote Edition 2021
177 min
React Hooks Tips Only the Pros Know
Top Content
Featured Workshop
Maurice de Beijer
Maurice de Beijer
The addition of the hooks API to React was quite a major change. Before hooks most components had to be class based. Now, with hooks, these are often much simpler functional components. Hooks can be really simple to use. Almost deceptively simple. Because there are still plenty of ways you can mess up with hooks. And it often turns out there are many ways where you can improve your components a better understanding of how each React hook can be used.You will learn all about the pros and cons of the various hooks. You will learn when to use useState() versus useReducer(). We will look at using useContext() efficiently. You will see when to use useLayoutEffect() and when useEffect() is better.
React, TypeScript, and TDD
React Advanced Conference 2021React Advanced Conference 2021
174 min
React, TypeScript, and TDD
Top Content
Featured WorkshopFree
Paul Everitt
Paul Everitt
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.
Web3 Workshop - Building Your First Dapp
React Advanced Conference 2021React Advanced Conference 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured WorkshopFree
Nader Dabit
Nader Dabit
In this workshop, you'll learn how to build your first full stack dapp on the Ethereum blockchain, reading and writing data to the network, and connecting a front end application to the contract you've deployed. By the end of the workshop, you'll understand how to set up a full stack development environment, run a local node, and interact with any smart contract using React, HardHat, and Ethers.js.
Designing Effective Tests With React Testing Library
React Summit 2023React Summit 2023
151 min
Designing Effective Tests With React Testing Library
Top Content
Featured Workshop
Josh Justice
Josh Justice
React Testing Library is a great framework for React component tests because there are a lot of questions it answers for you, so you don’t need to worry about those questions. But that doesn’t mean testing is easy. There are still a lot of questions you have to figure out for yourself: How many component tests should you write vs end-to-end tests or lower-level unit tests? How can you test a certain line of code that is tricky to test? And what in the world are you supposed to do about that persistent act() warning?
In this three-hour workshop we’ll introduce React Testing Library along with a mental model for how to think about designing your component tests. This mental model will help you see how to test each bit of logic, whether or not to mock dependencies, and will help improve the design of your components. You’ll walk away with the tools, techniques, and principles you need to implement low-cost, high-value component tests.
Table of contents- The different kinds of React application tests, and where component tests fit in- A mental model for thinking about the inputs and outputs of the components you test- Options for selecting DOM elements to verify and interact with them- The value of mocks and why they shouldn’t be avoided- The challenges with asynchrony in RTL tests and how to handle them
Prerequisites- Familiarity with building applications with React- Basic experience writing automated tests with Jest or another unit testing framework- You do not need any experience with React Testing Library- Machine setup: Node LTS, Yarn

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

A Guide to React Rendering Behavior
React Advanced Conference 2022React Advanced Conference 2022
25 min
A Guide to React Rendering Behavior
Top Content
React is a library for "rendering" UI from components, but many users find themselves confused about how React rendering actually works. What do terms like "rendering", "reconciliation", "Fibers", and "committing" actually mean? When do renders happen? How does Context affect rendering, and how do libraries like Redux cause updates? In this talk, we'll clear up the confusion and provide a solid foundation for understanding when, why, and how React renders. We'll look at: - What "rendering" actually is - How React queues renders and the standard rendering behavior - How keys and component types are used in rendering - Techniques for optimizing render performance - How context usage affects rendering behavior| - How external libraries tie into React rendering
Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a new web framework from the creators of React Router that helps you build better, faster websites through a solid understanding of web fundamentals. Remix takes care of the heavy lifting like server rendering, code splitting, prefetching, and navigation and leaves you with the fun part: building something awesome!
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced Conference 2023React Advanced Conference 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
React provides a contract to developers- uphold certain rules, and React can efficiently and correctly update the UI. In this talk we'll explore these rules in depth, understanding the reasoning behind them and how they unlock new directions such as automatic memoization. 
Using useEffect Effectively
React Advanced Conference 2022React Advanced Conference 2022
30 min
Using useEffect Effectively
Top Content
Can useEffect affect your codebase negatively? From fetching data to fighting with imperative APIs, side effects are one of the biggest sources of frustration in web app development. And let’s be honest, putting everything in useEffect hooks doesn’t help much. In this talk, we'll demystify the useEffect hook and get a better understanding of when (and when not) to use it, as well as discover how declarative effects can make effect management more maintainable in even the most complex React apps.
Routing in React 18 and Beyond
React Summit 2022React Summit 2022
20 min
Routing in React 18 and Beyond
Top Content
Concurrent React and Server Components are changing the way we think about routing, rendering, and fetching in web applications. Next.js recently shared part of its vision to help developers adopt these new React features and take advantage of the benefits they unlock.In this talk, we’ll explore the past, present and future of routing in front-end applications and discuss how new features in React and Next.js can help us architect more performant and feature-rich applications.
(Easier) Interactive Data Visualization in React
React Advanced Conference 2021React Advanced Conference 2021
27 min
(Easier) Interactive Data Visualization in React
Top Content
If you’re building a dashboard, analytics platform, or any web app where you need to give your users insight into their data, you need beautiful, custom, interactive data visualizations in your React app. But building visualizations hand with a low-level library like D3 can be a huge headache, involving lots of wheel-reinventing. In this talk, we’ll see how data viz development can get so much easier thanks to tools like Plot, a high-level dataviz library for quick & easy charting, and Observable, a reactive dataviz prototyping environment, both from the creator of D3. Through live coding examples we’ll explore how React refs let us delegate DOM manipulation for our data visualizations, and how Observable’s embedding functionality lets us easily repurpose community-built visualizations for our own data & use cases. By the end of this talk we’ll know how to get a beautiful, customized, interactive data visualization into our apps with a fraction of the time & effort!