Footer Component
The Footer component is a comprehensive and customizable footer for your Next.js application. It includes sections for the company logo, copyright information, various links, and social media icons.
Importing the Component
To use the Footer component in your Next.js application, import it as follows:
import { Footer } from '@/components/Footer';
Basic Usage
Here's a basic example of how to use the Footer component:
import { Footer } from '@/components/Footer';
const Layout = ({ children }) => {
return (
<div>
{children}
<Footer />
</div>
);
};
Functionality
The Footer component provides the following functionality:
- Displays the company logo and name.
- Shows a tagline and "Built With" information.
- Includes a copyright notice with the current year.
- Provides links to various pages grouped into "Links" and "Legal" sections.
- Displays social media icons with links to Discord, Twitter (X), and YouTube.
- Uses responsive design for different screen sizes.
Dependencies
This component relies on the following:
- Next.js (for routing and Link component)
- react-icons (for social media icons)
- A custom Logo component
- A custom BuiltWith component
- SiteConfig for site-specific information
- Routes object for page URLs
Customization
To customize the Footer component:
- Modify the
SiteConfig
object to update the site name and social media links. - Update the
Routes
object to change the URLs for different pages. - Modify the Tailwind CSS classes to adjust the styling.
- Replace the Logo and BuiltWith components with your own implementations.
- Add or remove links in the "Links" and "Legal" sections as needed.
- Customize the tagline "Start making money today" to match your site's purpose.
Styling
The component uses Tailwind CSS for styling. Key styling features include:
- Responsive layout using flexbox, switching from column to row layout on medium screens and above.
- Custom text sizes and weights for different elements.
- Hover effects on links and social media icons.
- Use of
text-muted-foreground
for less prominent text.
Accessibility
To ensure accessibility:
- All links have descriptive text or title attributes for screen readers.
- Social media icons use title attributes to describe their purpose.
- The component structure uses semantic HTML with a
<footer>
tag.
Best Practices and Improvements
- Consider making the links and social media information configurable through props or a configuration file.
- Implement internationalization (i18n) for multi-language support.
- Add aria-labels to icon-only links for better accessibility.
- Consider adding a newsletter signup form or additional interactive elements.
Example Usage in a Layout
Here's an example of how you might use the Footer component in a layout:
import { Footer } from '@/components/Footer';
import { Header } from '@/components/Header';
const Layout = ({ children }) => {
return (
<div className='flex flex-col min-h-screen'>
<Header />
<main className='flex-grow'>{children}</main>
<Footer />
</div>
);
};
export default Layout;
This example demonstrates how to use the Footer component within a layout, ensuring it appears at the bottom of every page that uses this layout.
By using the Footer component, you can easily add a comprehensive and customizable footer to your Next.js application. Remember to update the content, links, and styling to match your specific brand and design requirements.