React Website using Styled Components and Smooth Scroll - Beginner Project Fully Responsive
HTML-код
- Опубликовано: 24 июл 2024
- Learn how to build a React website using styled components and React smooth scroll. The website is fully responsive and we will be using React Hooks and React Router for this project. The main sections are reusable components that you can customize and reuse anywhere on your site.
If you want to follow me along my coding journey, be sure to subscribe :)
/ @briandesign
Access Source Code Here (Scroll to bottom of page)
briandesigns.gumroad.com/l/eZ...
Timeline
0:00 Website Design we're building
4:26 Creating React Project
9:18 Creating our Project Files
10:44 Creating Navbar
16:10 Styling Navbar
46:51 Creating Sidebar/Dropdown Menu
48:15 Styling Sidebar
1:07:22 Creating Home Page
1:14:21 Creating Hero Section
1:16:55 Styling Hero Section
1:32:50 Creating Button Element
1:43:12 Creating Reusable Info Section
1:47:22 Styling Info Section
2:06:08 Adding Data to Info Section
2:18:43 Adding Smooth Scroll to Info Section Buttons
2:33:18 Creating Services Section
2:37:06 Styling Services Section
2:47:53 Creating Sign In Page
2:48:39 Adding React Routes to Website
2:52:08 Creating Footer
2:59:15 Styling Footer
3:20:18 Changing Navbar background on scroll
3:24:52 Adding React Scroll to our site
3:34:20 Creating Sign In Component
3:38:52 Scroll to Top on Page/Route Change
Host your React Website for Free
• How to Host a Website ...
VS Code Theme I use
• Top 10 VS Code Themes
React Website with Styled Components using only React Router
• React Website Using St...
Great tutorial! I bought the source code, hope you can continue doing this and making new awesome vids.
Thanks for the support David! I plan on making more vids soon!
Sir this responsibility or only please say?
pass you source code , I don't have a credit card for a buy course
@@briandesign Hey Brian, my svgs and pngs will not render. I'm at a loss right now
I typed this exactly but my video is not getting played!
for anyone having issue with image not loaded make sure you type
img: require('../../images/svg-1.svg').default,
still isn't loading, it find the location of .svg file, reads but doesn't load
@@angarabozkirli Did your problem got fixed?
@@atharvaathalye no, I didn’t try further
@@angarabozkirli check your styled components for IMG I accidentally typed image that's why my image was not getting rendered
Do you know what would happen if there was no z-indexes whatsoever in this project?
If y'all are attempting this project using react-router-dom v6 you'll have to change Switch to Routes and in your Route component you have to change component to element. It should look like this --> . In the video this is at timestamp 2:49:26.
This worked! thank you!!!!!! except mine is SignInPage instead of SigninPage
I'm having an issue with displaying some of the elements in the InfoSection (p, heading and button) I was able to display the img but not the right of the elements. can you help?
You are a god amonst men
🙏🏻 Thank you ! Much love !
@@ennerie You are missing. import SigninPage from './pages/signin';
I love that we just go through the code and debug along the way. It really adds to realism!
Very rare to see react tutorials with actually good designs. You deserve the best, thank you for your amazing videos
Thanks Syndrms!
It's truly rare
mean u didn't know about Wrong Akram channel then..
So true
Bro I'm only like halfway through but this tutorial is clicking so much more for me than other, much longer and more in depth tutorials. I think maybe it's the order you are going through, combined with the pace. So relieved, finally this React stuff is starting to click in my boomer object oriented brain. Thank you.
That was great! I've never used styled components before and all the repetition and patterns you've demonstrated truly helped me build a strong foundation! Thank you!
Hey, how can we install styled components
These are going to help me get a job and when I am back on my feet Ima forward you for the source code still.Your a blessing still my guy.
Thanks for all you do man, I appreciate you walking through your errors makes it feel more authentic.
Unlike other channels, you not only teach React, but also focus on the design part of it which is immensely helpful. Thanks a ton, expecting more amazing content :D
Thanks Karthik! Yeah I like CSS lol so I tend to spend more time messing around with design stuff
@@briandesign Loving the design stuff you've included! It makes your sites look really professional. Can't believe you've not been doing this for very long!
@@loquaciouslaura5641 Thanks Laura!
I finally found the best front-end channel. god level styling skills
The most i like of your tutorials is you don't leave any case of doubt behind. I'm watching what you doing and at the moment that I stop and ask myself, what if i want to...? you say "and if you wanna try this, then you have to..." it's amazing. Thanks for all!
Thanks Pablo!
I just finished the tutorial and it took me at least 3 days. Awesome tutorial and I love how you debug the problems! New subscriber here!
Brilliant react project. Has a high level
For anyone struggling to get the image to show do this:
1. add an import statement at the top of the index.js file on infosection. import ImgCar from "../../images/car.svg"
2.
It's not the same as in the tutorial but this gets the image to show
EDIT:
Mustafa Bahaa posted a much more eloquent solution to this, he suggested adding .default to the end of the require statement.
thank you. The .default worked for me.
This one worked for me, thanks brooooooooo
Worked for me
@kanoj if you add that code to index.js, how do you make the other sections use different images?
Thanks
That .default has save me. Tyyy
Thank you for starting the video with the end result! So many videos out there where you have to wait a very long time before you can even see what is being built. Liked and subscribed.
I just want to say, you probably have the best tutorials Ive found! Thank you for the help!
Glad you like them! Thanks Christian!
Helpful hint - vscode has an extension for styled components
Thanks a lot man. I was wondering why mine was highlighted as a string and his was not.
thanks so much
Thank you, was just the comment i was looking for :D
Pin !
Without this plugin it's pain
u saved my life! thank you so much!
Your React using Styled Components have been a life saver. Hoping you do an ecommerce type of website soon! Would love to see what you do with that style
Thanks Caroline! Yeah I plan on making one in the future!
You teach not only how to develop in react but how to develop like a pro with a clean codebase. Just Awesome
Thanks!
Finally, someone who understands the importance of design!
Yooo, your channel is an absolute blessing. Learning and coding react apps is a lot more enjoyable now.
Thanks Anthony!
Brian coming up don't sleep. Love this man!
Yessir! Learning everyday
This is pretty much a great build. You pretty much covered a lot of stuff. You should pretty much keep making stuff like this! ;)
So .. I spent several hours watching your videos .. and well, I learned so much, thanks for taking the time and creating such long and informative videos
awesome! Thanks!
hint: if the images aren't loading in your react, use .default suffix to your img value/path
thanks it worked
hi how do you mean with that, can you write the code please. it doest work for me :(
"img: require('../../images/svg1.svg'),"
@@aisahtaufik8627 "img: require('../../images/svg1.svg')," would now be "img: require('../../images/svg1.svg').default,"
thanks a lot bro...how did you even find the solution to it??
thanks *-*
Amazing website appreciate the work you put in to this video.
Thanks Yudhiesh!
thanks from Brazil, i'm glad that you just give us this full content for free.. at moment, i cant help with money but here is my thank you! I learn a lot with this video !!
@Brian, you rock man! I was looking for something like this for a long time. You made my day. I totally loved to write code with you! keep up the great work. God bless.
If I could give more than one thumbs up, I would !
Amazing work.
Thanks Drey!
on the Styling hero section you forgot to include an ";" on z-index in the herocontainer, than you saved the file and (probably prettier) made the correction. Btw, i'm new here and i'm really enjoying react, thanks a lot man
Took me a couple months to fully complete but I'm glad I did, got a lot of knowledge out of this tutorial
Hi, nice to hear that, I wanna ask, do you have the same result as his??
Brian, you're an inspiration. Thank you for putting out this awesome content; sat here all morning learning all this new stuff. Subbed!
1:21:06 The problem is that you didn't have semi-colon at the end of line 12. But after saving, prettier formatted the file and added semi-colon.
You have solved my portfolio project issues xD
aye thanks!
This video solved a lot of problems for me in my fullstack developer journey. Great video!
really thank you Brian for helping us to be professional, my words aren't enough to thank you. Besides, I just finished creating this project step by step with you. Break a leg friend:)
For the svg loading problem I noticed that in InfoElements.js I wrote "styled.div" instead of "styled.img". Great tutorial! Thanks
glad you figured it out! those syntax errors always get me haha
you comment saved my life ! 😅✌️
Thanks brother
your comment saved my life ! 😅✌️ (copied)
Nice! This has had me stumped for the last hour!
I watched 4 minute of video and can't stop to comment dude this is what we need tnx for video and keep it up . Now i can continue to video ...
Amazing React tutorials. I love them. They're very easy to understand. Thank you.
Glad you like them!
Awesome tutorial! Fellow developers, in case you want to add extra pages like a signup you need to add a few thing extra props onto your styled-component.
Example:
Could you pls explain further about the signup
Hi Brian, your tutorials and design is awesome! Have one question, when you change navbar color with the addEventListener on scroll, shouldnt there be a cleanup function with that listener? And hows performance of that if you trigger that function on scroll? Any option for debounce? Thanks!
This video is amazing..Infact, Brian becane very tired at the end of the video.
many thanks goes to you, Brian.
you've earned a relentless subscriber from Nigeria!🔥🙌
I am love in with react after saw this video. Amazing content on youtube. I didn't saw this type of video on youtube yet.
use: 'import styled from 'styled-components/macro'; and you'll get the styled component name on the class instead of just random div classes created by the styled-components package
If this is placed in the style sheet then it will get a conflict due to the existance of import styled from 'styled-components'; ?
Brian, you do more for us than you realize. Bought your bundle in the hopes that you're going to continue to make great content!
You are literally the best programming channel on youtube.
What an amazing tutorial with neat explanations along the almost 4 hours there :)
I was wondering if you could create a reactstrap website tutorial ?
Appreciate it man!
I'll check it out! thanks
@@jegandranbalakrishnan6336 Hi there, yeah easy to follow and sure the same output. Is there any problem I could help?
bro provide the source code i need it urgently..send the github link
Love your content bro. Can you teach how to add carousels in react? Automatic image sliders with its transition animations for the banner.
Thanks for these awesome vidoes 👍
yea man! a sldieshow react one would be great, ive managed to do it before but took the real long gravelly road to get there
Dude there's tones of good packages out there
Wow, you're amazing! This is the second video I came across of yours in the last hour and I'm deffo a subscriber now!! Can't wait to see what else you post!
Great video tutorial! Seriously the effort you've put in creating this content is second to none! Great Job mate!
Thanks Giulio! you can search undraw . co for those svgs
Great tutorial bro, I would love you to explain more in-depth when you are typing the CSS/Styled-Component because we don't see the effect right away. Just a suggestion for upcoming projects ;)
yeah I changed the way I show it in my future videos, so it's much easier to follow along
@@briandesign is there a chance that you can resolve the failed to compile before you start styling so that we can actually what is happening it would be much easier to follow Thanks
RUclips has many tutorial on react , but in most part they skip the css part, which ended me as a poor css scripter. After following your videos, it became more clear and concise😉❤️
Thanks! Yeah I noticed not many people focus on CSS at all or just copy and paste it into their code with tutorials with more advanced languages.
@@briandesign I agree, the CSS element you include is very in depth. I feel total novice at this and would like to ask, where/how did you learn CSS so well?
@@briandesign Is it worth learning React? I'm a designer with basic notions of coding and programming (JS and PHP). But the website on the video is pretty easy to make using Webflow. I could build it in 2 hours... Without writing any code.
@@MrZxcvbnm22 yeah you can build almost any static site with wordpress/webflow etc. so unless you are trying to do something that requires react or any coding language, then it would make sense to learn it. If you don't plan on using it ever, then I don't see why you would want to use it
@@briandesign but whats th point of using react? (Serious question). Because now I'm using Webflow and I cant see the why. I'm building a concept web similar to Netflix. With the same interactions to see how far I could get and for now Webflow is enough.
ps: You used 'static', 'Wordpress' and 'Webflow' on the same sentance... xD
Excellent video, I sat through the course and then paid for the design. I will be using it for my Landing page.
i'm newer and this is a masterpiece for me, thank you very much
If you're images aren't loading and you have [object Module] in the src attribute, put .default after require() like that "require('../../img/svg-1.svg').default" it worked for me.
It worked for me as well, thank you for the tip Florian !
Thanks a lot man!!! You've solved my problem with the image.....
You da best . Thanks for the help may u never get corona :-D lol
Thank you !! It worked for me as well.
Thank you!
Hi, May I know why at 28:20 the "margin-top" causes the navbar to disappear but at 1:41:45 the "margin-top" only move the video instead of the navbar?
edit: the actual reason is cause of the Hero component, because it is under the navbar the negative margin top affects it (hero) instead of the navbar.
It's just how negative margins are, very confusing.
actually the best react video so far for me
So Underrated it's insane
Thanks man you deserve much more keep it up
Please do a personal-portfolio using React
2:08:42 add .default in the end otherwise picture will not be shown in current version of js
require(.../svg).default
Thank you Brian you made my beginner step to website design become a lottt easier
Thanks Rangga!
added to my watch later full of project builds lmao. thankyou :)
If you're having any issues with margins, instead of removing the App.css file, delete everything inside and replace it with *{margin: 0px; padding: 0px}. This will remove all default margins, and give you more freedom to work.
not sure why not its not working, nothing in *{} is taking - please help
Is there a way to donate? I just learned a lot and this deserves something, it's just amazing, thank you so much!
Thanks Josue! you don't have to do that, but I do have the source code in the description that you could purchase if you wanted to support
Bro, I've watched so many of your videos and just by looking at this design, I don't even need to watch this entire video at all to make this website, I think Im good enough to do all this by myself.
That’s awesome!
Hey, Thanks for this.
I am a software engineer who hated frameworks and wasn't too familiar with javascript, I wrote Java, C# before, A year ago I watched this and decided to give React a chance, Thanks to this video I got my first job as a React Developer just 2 months after watching this video (I had been an engineer for 4 years prior tho), and now I am a frontend developer, I love using react and styled-components so much, it's my fastest way to build stuff.
if anyone having an issue with images, put the folder into public instead then in data: img: '/images/svg-1.svg'
thanks a lot
i am struggling with images, i tried to put image into folder public, but it's not worked for me. any Tip?
@@ricardoquirino3515 make an images folder in public and put them in there
@@Nathan-pu9um Thanks Nathan for help me, but it's not worked for me. i did it but i don't know why doens't work.
@@Nathan-pu9um how are you... iam getting this error Module not found: You attempted to import /images/7335.jpg which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
Hey thanks for the video but i have this issue:
img:require('../../images/svg-2.svg'),
not working
please some help
you could try adding the images to your public folder then just use
img: './images/svg-2.svg',
let me know if that works
@@briandesign Perfectly worked thanks but one question why it didn't works with require method?
@@briandesign ty Mr! u inspire me!
@@briandesign no idea why, but this doesnt work
This is a fantastic video, I'm using the template to build a website for my friend's small business!
Master! Absolutely brilliant tutorial, well done!
If your CSS is not being formatted in your Elements.JS files, install the plugin "vscode-styled-components"
I got an error it's not registerd !!!
thank you my lord savior
thank u so much bud
svg not displaying from data js. showing this [object Module] content in src
I'm experiencing the same issue.
Just move the folder images in to public and then in data.js write this: img: '../../images/svg-1.svg' p.s.- DON'T USE REQUIRE!!!
You should import svg files.
@@damjankar Thanks yo
@@soniyatirvir9176 you’re welcome :)
This looks amazing yo, cant wait to start.
Really amazing work man, I recently created my first mern project to show employers and next was thinking about making portfolio page, this video is inspiring, might create something similar, looking forward to see how you solved some parts! Cheers
Nice!
Had to type img: require('../../images/svg-1.svg').default, to get the img working. at about 2:17:00
I imported the svg's in the top of the file as "import svg from "../../images/svg.svg". Also works.
its still not working for me
@@atharvaathalye it worked or not because I found the solution
@@LiquidMasti whats the solution
@@elvisstuffman9083 just store location path of image in veriable and call it from props. If you still didn't get it let me know I will give you coding example 🙂
Its hard to visualize your styled components since he is teaching to create them first so its hard to understand what exactly the css is doing without being familiar with css and knowing things off by experience. Also, when he uses state inside the styled component and then adds said state as a prop then making the value the state is confusing as hell. Example in the navbar index.js file you see we have state which is scrollNav and we made a prop named scrollNav which value is the state this is confusing because thought you had to destructure in the component parentheses to make props? or add "props" inside the parentheses and do props.scrollNav or something. So, the function changeNav is being called each time a scroll event happens which then updates the state based on if the scroll is greater or equal to 80. I just don't understand the scrollNav prop and how he defined it without de-structuring or adding props to the parenthesis.
Brian you must raise up! thank you so much It's really helpful
Nice tutorial video, thank you so much. I'm looking forward to seeing more videos on your channel.
Thansk for the tutorial, im learn alot about styled component in this video.. keep it up sir!!!!
if I can just subscribe to you a thousand times, I think I'm done doing that now. Please continue making awesome vids
Thanks giving me some ideas of css styling, though I think the main concept of real styled-component is making it globally and sharing it, because styled-component could use multiple times and do nesting. Just watched halfway and felt like I am writing normal css. But thanks again, your work is well-design and full of nice ideas.
Man, your content is so dope! Congrats
this is the best youtube react tutorial. Please keep it up..
I'm literally downloading every video of yours, damn ur videos are good
You are legend! Thank you so much for such interactive react app.
Please upload more 🙌🏻✨
Thank you! Will do!
Love your stream of consciousness oration style: talking about link routers --- "It's like whoaaaa, where's that coming from?" Rofl keep up the good work man.
Thanks for the great tutorial. Keep it up! Really enjoyed the workflow and the finished project
Glad it was helpful!
Really nice tutorial man. Well structured and clean! Keep it up. Much love from Portugal! ❤️
Awesome! Thank you!
This is a great and detailed tutorial for beginners, thank you so much..
Video duration 4 hour = 4 day for learn from zero until create a responsive website... great tutorial... you give me all i want
Glad it helped!
This is so dope man, watched a few of your vids now and happily subbed! Your account's gonna blow up soon for sure, keep it up my friend.
Thanks Asher!
I am using your videos to upgrade my projects. Thank you.
Amazing tutorials ! thank to you, I am now able to create websites ! You helped me a lot ! Good continuation
This is a awesome tutorial tailored for beginners. Thanks so much bro
Thanks Brian, amazing work!
i was searching about something like long time ago and finally thank you so much you the best
Awesome!
Your work is really appreciable, Best wishes for your future, Brian :)
Thanks Praveen!
Thank you for igniting interest in me for Development. I am trying my best to learn and make cool stuff...❤️
Thanks for the tutorial.
I love the design. Looks cool.
Thanks Nahida!