Skip to main content

Profile Components

The profile components render user profile pages with a cover banner, avatar, personal information, social links, and tabbed content sections for about, portfolio, skills, and submissions.

Architecture Overview

template/components/profile/
index.ts # Barrel exports
profile-content.tsx # Tabbed content container
profile-header.tsx # Cover banner, avatar, info card
profile-navigation.tsx # Tab navigation bar
profile-tag.tsx # Profile tag badge component
sections/
about-section.tsx # About/bio section
portfolio-section.tsx # Portfolio showcase section
skills-section.tsx # Skills and expertise display
submissions-section.tsx # User's directory submissions

Exports

The index.ts barrel provides all public exports:

export { ProfileHeader } from "./profile-header";
export { ProfileNavigation } from "./profile-navigation";
export { ProfileContent } from "./profile-content";
export { AboutSection } from "./sections/about-section";
export { PortfolioSection } from "./sections/portfolio-section";
export { SkillsSection } from "./sections/skills-section";
export { SubmissionsSection } from "./sections/submissions-section";

ProfileHeader

The hero section of the profile page, featuring a gradient cover banner, overlapping circular avatar, and a card with user details.

import { ProfileHeader } from '@/components/profile';

<ProfileHeader
profile={userProfile}
isOwnProfile={true}
/>

ProfileHeaderProps

PropTypeDefaultDescription
profileProfilerequiredUser profile data object
isOwnProfilebooleanfalseShow edit controls when viewing own profile

Profile Data Shape

The component expects a Profile type from @/lib/types/profile:

PropertyTypeDescription
displayNamestringUser's display name
jobTitlestringProfessional title
biostringShort biography text
avatarstringURL to avatar image
locationstringGeographic location
companystringCompany name
websitestringPersonal website URL
socialLinksSocialLink[]Array of social platform links

Each social link has the shape:

interface SocialLink {
platform: string; // "github", "linkedin", "twitter", or other
url: string; // Full URL
displayName: string; // Display text
}

Platform icons are mapped automatically:

PlatformIcon
githubFiGithub
linkedinFiLinkedin
twitterFiTwitter
(default)FiGlobe

Visual Design

  • Cover Banner: Gradient from --theme-primary to --theme-secondary CSS variables with dark overlay
  • Avatar: 24x28px circular image with white ring, shadow, and error fallback (shows FiUser icon)
  • Info Card: Positioned to overlap the cover with shadow and border-0 styling
  • Edit Button: Shown only for isOwnProfile, positioned on the avatar with FiEdit2 icon

Avatar error handling resets when the avatar URL changes via a useEffect dependency.

ProfileContent

The tabbed content area below the header. Manages tab state and renders the appropriate section.

import { ProfileContent } from '@/components/profile';

<ProfileContent profile={userProfile} />

ProfileContentProps

PropTypeDescription
profileProfileUser profile data

Available Tabs

Tab IDLabelComponent
"about"AboutAboutSection
"portfolio"PortfolioPortfolioSection
"skills"Skills & ExpertiseSkillsSection
"submissions"SubmissionsSubmissionsSection

Each section is wrapped with a ProfileSectionHeader that renders a styled h2 with a bottom border.

ProfileNavigation

Tab navigation bar for switching between profile sections.

import { ProfileNavigation } from '@/components/profile';

<ProfileNavigation
activeTab="about"
onTabChange={(tab) => setActiveTab(tab)}
/>

ProfileNavigationProps

PropTypeDescription
activeTabstringCurrently active tab ID
onTabChange(tab: string) => voidTab selection callback

Profile Sections

AboutSection

Displays the user's detailed biography and personal information. Renders formatted text content from the profile data.

<AboutSection profile={profile} />

PortfolioSection

Showcases the user's portfolio items with images, descriptions, and links. Useful for creators and freelancers to display their work.

<PortfolioSection profile={profile} />

SkillsSection

Displays the user's skills and areas of expertise, typically rendered as tags or badges with optional proficiency indicators.

<SkillsSection profile={profile} />

SubmissionsSection

Lists the directory items that the user has submitted. Shows submission status, dates, and links to the items.

<SubmissionsSection profile={profile} />

ProfileTag

A badge component for displaying tags on profile pages with consistent styling.

Styling Patterns

The profile components follow these design conventions:

  • Responsive Layout: Mobile-first with md: breakpoints for desktop
  • Centering: Avatar centered on mobile, left-aligned on desktop via left-1/2 md:left-12
  • Hover Effects: Social link buttons with backdrop blur and shadow transitions
  • Dark Mode: Full support through dark: Tailwind variants
  • Glass-morphism: Social link buttons use bg-white/80 dark:bg-gray-800/80 backdrop-blur-xs

Integration Example

import { ProfileHeader, ProfileContent } from '@/components/profile';
import type { Profile } from '@/lib/types/profile';

function ProfilePage({ profile, isOwner }: { profile: Profile; isOwner: boolean }) {
return (
<div className="min-h-screen bg-gray-50 dark:bg-gray-900">
<ProfileHeader profile={profile} isOwnProfile={isOwner} />
<div className="py-8">
<ProfileContent profile={profile} />
</div>
</div>
);
}

Icon Dependencies

Profile components use react-icons/fi (Feather Icons) for all icons:

IconUsage
FiEdit2Edit profile button
FiMapPinLocation display
FiBriefcaseCompany display
FiGlobeWebsite link and fallback social icon
FiGithubGitHub social link
FiLinkedinLinkedIn social link
FiTwitterTwitter social link
FiUserAvatar fallback