This tutorial explains how to edit the provided HeroComponentTwo component. You'll learn how to:
Change the heading, subheading, and button text.
Update the button links.
Edit the logo stacks to use your own images, update
alt
text, and add or remove logos.Understand best practices to ensure a polished and accessible final component.
Project Resources
Tutorial
Step 1: Editing the Heading and Subheading
Locate the following section of code:
Heading (
<h1>
):
ReplaceVoluptatum sequi dolorum atque vitae.
with your desired headline.Subheading (
<Body1>
):
ReplaceLorem, ipsum dolor sit amet consectetur...
with a short description about your product or service.
Example Update:
Step 2: Updating Button Text and Links
Find the code for the buttons:
Update Button Text:
ReplaceJoin for free
orSee our plans
with your desired button labels (e.g.,Get Started
orExplore Features
).Update Links (
href
):
Change/signup
or/pricing
to the appropriate paths in your app.
Example Update:
Step 3: Customizing Logo Stack Images
Updating the Rotating Logo Stack
Locate the logoStackImages
array:
Replace Image Paths (
src
):
Updatesrc
with the path to your own images. If you're using local files, ensure they are stored in a directory likepublic/images/icons
.Update Alt Text (
alt
):
Provide a meaningful description for each image. Goodalt
text improves accessibility and SEO.
Example Update:
Updating the Static Logo List
Locate the logoImages
array:
Follow the same steps: Update
src
andalt
for each logo.
Step 4: Adding or Removing Logos
Add a Logo:
Add a new object to eitherlogoStackImages
orlogoImages
arrays:Remove a Logo:
Delete the object from the array.
Best Practices
Ensure Alt Text Accuracy:
Always provide descriptivealt
text for each image. This improves accessibility and allows screen readers to describe the images to visually impaired users.Optimize Images:
Compress your images to reduce load time and ensure they are the correct dimensions (e.g., 300px for logos).Preview Your Changes:
Run your app locally usingnpm run dev
and ensure your updates appear as expected.
Step 5: Testing Your Changes
Run Your Application:
Usenpm run dev
oryarn dev
to view your changes locally.Verify Responsiveness:
Resize your browser to check that the component looks good on mobile, tablet, and desktop screens.Check Animation Timing:
Confirm that the logo stack cycles smoothly every 3 seconds (or adjust the timing by modifying the interval duration in theuseEffect
).
By following this guide, you can easily customize the HeroComponentTwo component to fit your branding and design needs.