When I started learning React, I wanted a small project that would help me understand layouts, components, and list rendering.
Thatโs how I built my โFar Away ๐ผ Packing List Appโ โ a simple app to keep track of what you need for your next trip.
In this post, Iโll share how I structured it, the main concepts I learned, and how to make it look clean with modern CSS.
โ๏ธ Setting Up the App
First, I created a new React app using:
npx create-react-app faraway
Then, inside App.js, I imported React and started defining my layout:
import React from "react";
function App() {
return (
<div className="app">
<Logo />
<Form />
<PackingList />
<Stats />
</div>
);
}
Each part of the app is its own component, keeping the code modular and reusable:
-
<Logo />โ shows the title -
<Form />โ handles adding new items -
<PackingList />โ renders the list of packed items -
<Stats />โ displays summary info
๐งฉ Rendering Lists in React
The heart of this app lies in list rendering.
I started with an array of objects called initialItems:
const initialItems = [
{ id: 1, description: "Passports", quantity: 2, packed: false },
{ id: 2, description: "Socks", quantity: 12, packed: true },
];
Then I displayed them using Reactโs .map() method:
{initialItems.map((item) => (
<Item key={item.id} item={item} />
))}
Each Item component receives its data as props and displays it dynamically.
This is how React efficiently renders lists without reloading the whole page.
๐จ Styling with CSS Grid and Flexbox
For layout, I used CSS Grid to structure the app and Flexbox for alignment.
Hereโs the layout setup:
.app {
display: grid;
grid-template-rows: auto auto 1fr auto;
height: 100vh;
}
This makes the app fill the screen with flexible rows โ
Header โ Form โ List โ Footer.
For the list itself:
.list ul {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.2rem;
overflow-y: auto;
scrollbar-width: none; /* Firefox */
}
.list ul::-webkit-scrollbar {
display: none; /* Chrome/Safari */
}
This creates a responsive grid that adapts to screen size and hides scrollbars for a clean look.
๐ก What I Learned
Here are the main takeaways from this small but powerful project:
- ๐งฑ Component-based thinking โ every part of UI can be a component
- ๐ Rendering lists โ how
.map()works and whykeyprops matter - ๐จ Layout design โ combining Grid + Flexbox for adaptive UIs
- ๐ง Separation of concerns โ keeping logic and UI neat and independent
๐ Whatโs Next
In the next version of this app, Iโll add:
- Ability to add and remove items
- Mark items as packed/unpacked
- Display percentage of items packed
Thatโs where state and event handling in React will come into play โ the real magic behind dynamic UIs.
๐ Final Thoughts
This mini project taught me more than I expected โ especially how small details like layout, mapping, and clean code structure matter in real projects.
If youโre new to React, start with something small but visual like this.
Youโll build confidence and understand how React really โthinksโ under the hood.
โ๏ธ Written by Usama-dev
๐ป React learner documenting the journey โ one project at a time.
Top comments (0)