Portfolio Component

A dynamic portfolio component featuring animated interactions, bio sections, and social links with smooth state transitions.

Mihir (OPM)

Written by Mihir (OPM)

J

Hello, I'm

John

It's been 5 years since I got into design. I now have clear principles, the main one being “value instead of mindless execution”. It's easy to print generic solutions, but what we designers are hired for is our unique point of view and creative thinking. Usability combined with aesthetics is the key to memorable and enjoyable products.

The Portfolio component creates an interactive and animated profile card that expands to reveal bio information and social links. It features smooth transitions between states and provides a modern, engaging user experience perfect for personal websites and portfolio displays.

Installation

Examples

Default Configuration

import Portfolio from "@/components/portfolio";
 
export default function Example() {
  return (
    <Portfolio
      config={{
        firstName: "John",
        experience: 5,
        domain: "design",
        role: "designers",
        bioText: {
          prefix: "It's been",
          emphasis1: "years",
          midText: "since I got into design. I now have clear principles, the main one being",
          emphasis2: "value instead of mindless execution",
          suffix: ". It's easy to print generic solutions, but what we designers are hired for is our unique point of view and creative thinking."
        },
        colors: {
          bioButton: "bg-orange-600",
          menuButton: "bg-blue-600",
          plusButton: "bg-green-600"
        }
      }}
    />
  );
}
import Portfolio from "@/components/portfolio";
 
export default function Example() {
  return (
    <Portfolio
      config={{
        image: "/path/to/profile.jpg",
        firstName: "Sarah",
        experience: 8,
        domain: "development",
        role: "developers",
        colors: {
          bioButton: "bg-purple-600",
          menuButton: "bg-indigo-600",
          plusButton: "bg-emerald-600"
        },
        cvLink: "https://example.com/cv",
        twitterUrl: "https://twitter.com/username",
        githubLink: "https://github.com/username",
        layersLink: "https://portfolio.com"
      }}
    />
  );
}

Configuration

The component accepts a configuration object with the following interface:

type PortfolioConfig = {
  // Basic Info
  image?: string;
  firstName: string;
  experience: number;
  domain: string;
  role: string;
 
  // Bio Content
  bioText: {
    prefix: string;
    emphasis1: string;
    midText: string;
    emphasis2: string;
    suffix: string;
  };
 
  // Styling
  colors: {
    bioButton: string;    // Tailwind color class
    menuButton: string;   // Tailwind color class
    plusButton: string;   // Tailwind color class
  };
 
  // Links
  cvLink: string;
  twitterUrl: string;
  layersLink: string;
  githubLink: string;
};

Features

The Portfolio component includes several interactive features:

  • Animated state transitions using Framer Motion
  • Three distinct states: closed, open, and bio view
  • Social media links menu with icons
  • Customizable biography text with emphasized sections
  • Profile image support with fallback to initials
  • Responsive design with mobile optimization
  • Color customization for different UI elements
  • Interactive plus button with rotation animation
  • Bio visualization with custom waveform design
  • Smooth menu transitions with icon animations

Styling

The component uses Tailwind CSS for styling and supports customization through:

  • Custom background colors for buttons
  • Responsive sizing and spacing
  • Smooth transitions and animations
  • Hover state effects
  • Flexible layout adaptation

Best Practices

  1. Provide appropriately sized profile images (recommended 42x42px)
  2. Use contrasting colors for better visibility
  3. Keep bio text concise for better readability
  4. Ensure all links are valid and accessible
  5. Test animations on different devices and browsers
  6. Maintain consistent color themes across buttons