From the course: Building Modern Projects with React
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Creating a styled-component - React.js Tutorial
From the course: Building Modern Projects with React
Creating a styled-component
- [Instructor] Alright, so now that we've discussed what styled-components are in a React application, let's get started with them. And the first thing we're going to need to do here, of course, is install the styled-components package. Alright, so you're going to want to open up a terminal and make sure you're inside the todo-list-app. And then you're going to say npm install styled-components, and hit Enter. And that should take only a second or two to install, and once it's installed, we should be able to use them. So let's create a styled-component here. And what we're going to do specifically is go into our ToDoListItem, and we're going to add a little bit of styling to this thing by creating a styled-component that'll make it look like a floating card with a drop shadow. So this should be pretty straightforward. What we're going to do is we're just going to say... First of all, we need to import the styled-components package by just saying import styled from styled-components…