Recommended resources
The freely available resources this lesson will direct you to.
In the last lesson, we surveyed the landscape of powerful, designer-friendly libraries that can dramatically improve the quality of AI-generated UIs. You learned to recognize the "big four": Tailwind CSS for styling, Shadcn/UI for components, Framer Motion for animation, and Lucide for icons.
Today, we're moving from theory to practice. We'll take one of those libraries, Lucide, and go through the exact steps your AI assistant would ask you to perform to add it to a project. This lesson is all about demystifying the workflow of incorporating a new "part" into your application. By the end, you will be able to confidently add the Lucide icon library to a project and use its icons, complete with your own design customizations.
The Anatomy of Adding a Package
Think about one of your 3D printing or robotics projects. Before you can use a specific sensor or a pre-designed bracket, you first have to acquire the part and add it to your inventory. Then, you integrate it into your build.
Adding a code package follows the exact same logic. It's a two-step process:
- Add the Library: You use a terminal command to download the package (the "part") from a central repository (like a parts warehouse) and place it into your project's "inventory" (the
node_modulesfolder). - Use the Component: You write code to import a specific piece from that library (like a single icon) and place it onto your user interface, customizing its properties.

Let's walk through this process with Lucide.
Step 1: Browse the Catalog and Install the Package
Just as you'd browse a catalog for the right motor or bearing, your first step is often to visit the library's website to find the specific icon you need and its name.

Imagine you're building a settings page and need a gear icon. You'd go to the Lucide site, search for "settings" or "gear," and find that the icon is named Cog.
Now that you know what you want, you need to add the library to your project. As we covered in Module 2, the command for this is npm install. This command tells the Node Package Manager to find the library on the npm registry, download it, and place it in your project.
The following article provides a concise guide for installing and using Lucide in a web project.
Unleashing the Power of Lucide: The Ultimate Icon Library ...
This article from dev.to walks through the essential steps to get started with lucide-react, the version of Lucide made for React-based web projects.
First, read the section on installation. This shows you the exact npm command you would run in your terminal. Next, read the "Usage" section, focusing on the code example. Pay close attention to the two key lines: the import statement at the top and the <Home /> component used in the HTML.
Let's break down what you just saw in that code example:
-
Installation in Terminal:
npm install lucide-reactThis command downloads the package. You only need to do this once per project.
-
Usage in Your Code File (e.g.,
SettingsPage.js):// 1. Import the specific icons you need by name import { Cog } from 'lucide-react'; // 2. Use it in your UI like any other HTML element function SettingsPage() { return ( <div> <h1>Settings</h1> <Cog /> {/* This will render the gear icon */} </div> ); }
This import -> render pattern is fundamental to how modern web development works. You're telling the project, "From the lucide-react library I installed, I specifically want to use the Cog icon," and then you place it where it needs to go.
Step 2: Customize the Icon
This is where your design skills come into play. A raw icon is just a starting point. Lucide icons are designed to be easily customized using "props"—properties you pass to the component to change its appearance. This is directly analogous to changing the color, stroke, or size of a vector shape in Figma or Illustrator.
Let's look at the same article again to see how this is done.
Unleashing the Power of Lucide: The Ultimate Icon Library ...
Now let's focus on how to apply your design decisions to the icons.
Read the section titled ">How to customize</tf>. Notice how props like color, size, and strokeWidth` are added directly to the component tag.
As the article shows, you can easily modify an icon:
// A standard gear icon
<Cog />
// A larger, teal gear icon with a thicker stroke
<Cog size={48} color="teal" strokeWidth={3} />
This immediate, declarative control is what makes libraries like this so powerful for vibe coding. You can tell your AI assistant, "Add the Cog icon from Lucide, make it 48px, and color it teal," and the AI knows exactly what code to generate.
What About Mobile Apps?
Since you're interested in web, iOS, and Android development, you might be wondering if this process is different for a mobile app built with a tool like React Native. The great news is that the fundamental pattern remains almost identical.
The Lucide team provides a separate package specifically for React Native, but the workflow is the same: install, import, and use.
This is the official guide for using Lucide in a React Native project. As you read, compare the steps to the web version we just looked at.
First, look at the Installation section. Note the slightly different package name: lucide-react-native. Next, review the Example section. See the familiar import statement and the use of the <Camera /> component? Finally, look at the Props table. You'll see the same customizable properties: size, color, and strokeWidth.
The consistency of this workflow is a key takeaway. Once you understand the npm install -> import -> render pattern, you can apply it to countless packages across both web and mobile platforms. You've unlocked a core concept of modern development.
Conclusion
You've successfully bridged the gap from knowing about a library to knowing how to use it. By walking through the process of adding and customizing Lucide icons, you've learned a fundamental skill that applies to nearly any package you'll encounter.
Key Takeaways:
- Three-Step Pattern: Adding a package follows a consistent pattern:
- Find: Browse the library's documentation or website to find the component you need.
- Install: Use
npm install <package-name>in your project's terminal to download the code. - Use:
importthe specific component into your file and then render it in your UI, customizing it with props.
- Props as a Design Tool: Customization happens through
props(size,color, etc.), which is the code equivalent of a properties panel in a design application. - Cross-Platform Consistency: The basic workflow for adding packages is remarkably similar whether you are building for the web (React) or for mobile (React Native).
In our last few lessons, we've focused on the "parts" of an application—the libraries that provide functionality like icons, animations, and components. In the next lesson, we'll zoom out to look at the "chassis" that holds all these parts together: frameworks like Next.js and React Native.