Skip to main content

Overview

Astro Portfolio v3 includes a collection of reusable components organized into different categories. This guide will help you understand and customize these components to match your needs.

Component Organization

Components are organized in the following structure:

Shared Components

These are the most commonly customized components that appear throughout the site.
A reusable section header component with title and subtitle.

Props

string
required
The main heading text
string
required
The description text below the heading
'primary' | 'secondary'
default:"'primary'"
The color of the accent bar

Usage

Customization Example

Modify src/components/shared/SectionHeader.astro to change the layout:
The main navigation bar component at the top of the page.Location: src/components/navs/Navbar.astro

Customization Ideas

  1. Add Navigation Links
  1. Change Logo Style

Home Page Components

Components specific to the homepage are located in src/components/home/.
component
Displays the main hero section text and call-to-actionFile: src/components/home/HeroText.astro
component
Shows the hero image with animationsFile: src/components/home/HeroImage.astro
component
The about section with your description and imageFile: src/components/home/About.astro
component
Displays your work experience timelineFile: src/components/home/WorkExperience.astro
component
Showcases your projects in a grid layoutFile: src/components/home/Projects.astro
component
Lists recent blog postsFile: src/components/home/Blogs.astro

Creating Custom Components

Follow these steps to create your own custom component:
1

Create the component file

Create a new .astro file in the appropriate directory:
2

Define the component

src/components/shared/CustomBadge.astro
3

Export from index

Add to src/components/shared/index.ts:
4

Use in your pages

Component Best Practices

Keep components focused: Each component should have a single, well-defined purpose.
Use TypeScript interfaces: Always define prop types for better development experience.
Make components responsive: Use Tailwind’s responsive prefixes (sm:, md:, lg:) for mobile-first design.
When modifying components that use transition:name attributes, be careful not to create duplicate names, as this can break Astro’s view transitions.

Advanced Customizations

Adding Interactive Features

For components that need client-side interactivity, use Astro’s <script> tag:

Using Framework Components

Astro supports React, Vue, Svelte, and other frameworks. To use a React component:

Component Examples Repository

Check out the existing components in the source code for more examples:
  • Glow effect: ArticleCard.astro:95-146
  • Theme detection: ThemeSwitcher.astro:46-82
  • Modal implementation: ShareModal.astro
  • Form handling: NewsletterForm.astro