Lesson 4 - Create Footer Component
Layout Structure of Footer Componet
// Layout Design of Footer Component
Footer Component
│
└── Render Structure
└── <footer> (bg-dark text-light py-4 mt-5)
└── <div> (container text-center)
├── <p> - Copyright text
│ └── "© 2025, KOIDA BookShelf"
│
└── <div> (d-flex justify-content-center) - Social Media Links
├── <a> (text-light mx-3) - Instagram Link
│ ├── href="https://www.instagram.com"
│ ├── target="_blank"
│ ├── rel="noopener noreferrer"
│ └── Content: <i className="fab fa-instagram"></i> Instagram
│
├── <a> (text-light mx-3) - YouTube Link
│ ├── href="https://www.youtube.com"
│ ├── target="_blank"
│ ├── rel="noopener noreferrer"
│ └── Content: <i className="fab fa-youtube"></i> YouTube
│
├── <a> (text-light mx-3) - Facebook Link
│ ├── href="https://www.facebook.com"
│ ├── target="_blank"
│ ├── rel="noopener noreferrer"
│ └── Content: <i className="fab fa-facebook"></i> Facebook
│
└── <a> (text-light mx-3) - Twitter/X Link
├── href="https://www.twitter.com"
├── target="_blank"
├── rel="noopener noreferrer"
└── Content: <i className="fab fa-twitter"></i> X
Explanation of Footer.jsx Code Structure
Footer.jsx Code StructureThe Footer component provides the footer section of the app, including copyright information and links to social media platforms. Here's a step-by-step breakdown:
1. Importing Libraries
React: Required to build the component.
Bootstrap: Used for styling the footer and ensuring responsiveness.
2. Component Declaration
Purpose:
Define the
Footeras a stateless functional component.No props are required since the content is static.
3. Footer Layout
footerTag:Represents the footer of the page.
Styled with
bg-dark(dark background) andtext-light(light text) classes.py-4: Adds vertical padding for spacing.mt-5: Adds top margin to separate it from the main content.
4. Copyright Information
Displays copyright information:
©: HTML entity for the copyright symbol.2025, KOIDA BookShelf: Static text representing the app name and copyright year.
5. Social Media Links
d-flex justify-content-center:Creates a flexbox layout to horizontally align the links.
Links:
Each link directs users to a social media platform (
Instagram,YouTube,Facebook, andX).target="_blank": Opens the link in a new tab.rel="noopener noreferrer": Improves security for external links.
Font Awesome Icons:
Each link uses an icon (
fab fa-[platform]) for a better visual experience.Ensure Font Awesome is included in your project to render icons.
6. Exporting the Component
Purpose:
Makes the
Footercomponent reusable in the parent application.
Key Takeaways for Students:
Bootstrap Styling:
Use classes like
bg-darkandtext-lightfor predefined styles.Utilize flexbox utilities (
d-flex justify-content-center) for alignment.
Social Media Links:
Ensure links are secure with
target="_blank"andrel="noopener noreferrer".Enhance visual appeal with icons from libraries like Font Awesome.
Static Content:
Learn how to create a component with static, non-dynamic data.
Component Integration:
The
Footercomponent is standalone and ready to be included inAppBookShelf.jsx.
Last updated