Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 8894

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 28, 20242024-11-28T05:22:12+00:00 2024-11-28T05:22:12+00:00

Build a Portfolio Using Next.js, Tailwind, and Vercel with Dark Mode Support

  • 60k

Steps to build a portfolio website using Next.js and Tailwind with Dark Mode Support.

You can build a portfolio like mine after reading this article.

A portfolio is a place where you can showcase all your skills to the world. As a developer, you really need a portfolio to showcase your projects, blogs, and much more.

But why do we need to build a portfolio with Next.js? We all know next.js is react framework with out-of-box performance. So you are not required to worry about your portfolio performance. Everything is taken care of by next.js and Vercel. Let's get into action 

Next.js and Tailwind Configuration

We can configure tailwind with next.js with a single command. As below:

  npx create-next-app -e with-tailwindcss your-portfolio-name   
Enter fullscreen mode Exit fullscreen mode

The above command automatically configures your Tailwind setup based on the official Next.js example.

Once the installation is completed navigate to your project folder using cd your-portfolio-name and start the dev server using yarn dev command. You can see the below page if you hit http://localhost:3000 in the browser.

welcome

Creating Navigation Section

Create a components folder in the root directory to add your portfolio components. Create a file called Navigation.js and add the below code:

The navigation component is the header section of your portfolio. In the above code, you can see dark: class to support dark mode. Add the Navigation component to _app.js file as below. MyApp component is used to initialize pages.

Creating Footer Section

To add a Footer with social links, Create a Footer.js file in the components folder and add the below code:

Add the Footer.js component to _app.js file as below

About Component

Create About.js file inside components folder and add the below code:

I just added some dummy texts above for the demo. Include your profile image from the public folder as above. Placeholder blur prop in image component is to add loading effects. Import About component to index.js file as below:

I have removed the older template code and added the above code. Now your portfolio looks like below:

about-screen

Dark Mode Support

Now let's add dark mode to our portfolio. Adding dark mode is very simple. Create ThemeSwitch component to add a toggle switch to toggle between Dark Mode and Light Mode. 

To support Dark Mode in Next.js we need to add next-themes package to our dependency. Now import useTheme from next-theme to ThemeSwitch Component as below:

Add ThemeSwitch Component to Navigation component and include next-themes ThemeProvider in _app.js as below:

attribute=class is to enable dark and light mode manually. I have disabled system preference by enableSystem=false

Change darkMode option to class in tailwind.config.js file to toggle dark mode manually instead of relying on the operating system preference.

After the above changes, our portfolio looks like below:

Light Mode

Light Mode

Dark Mode

Dark Mode

Deploying in Vercel

You can deploy your portfolio in Vercel within 2 steps as below:

  1. Create a Vercel Account
  2. Connect your repository and click deploy.

Conclusion

You can add multiple pages like projects, blogs by creating new files inside the pages folder. I hope you have found this useful.

Thank you for reading.

Get more updates on Twitter.

You can support me by buying me a coffee ☕

eBook

Debugging ReactJS Issues with ChatGPT: 50 Essential Tips and Examples

ReactJS Optimization Techniques and Development Resources

Twitter Realtime Followers Count

Twiter Stats

More Blogs

  1. Twitter Followers Tracker using Next.js, NextAuth and TailwindCSS
  2. 10 React Packages with 1K UI Components
  3. No More ../../../ Import in React
  4. Redux Toolkit – The Standard Way to Write Redux
  5. 5 Packages to Optimize and Speed Up Your React App During Development
  6. How To Use Axios in an Optimized and Scalable Way With React
  7. 15 Custom Hooks to Make your React Component Lightweight
  8. 10 Ways to Host Your React App For Free
  9. How to Secure JWT in a Single-Page Application
  10. Redux Auth Starter: A Zero Config CRA Template

javascriptnextjsreactwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.