Component Architecture Overview
Thalyson’s Portfolio is built with a modern React component architecture using Next.js 14, TypeScript, and a carefully curated UI component library based on Radix UI primitives.Directory Structure
The component architecture is organized into several key directories:Component Categories
UI Primitives (/ui)
Core reusable UI components built on top of Radix UI:
- Form Controls: Button, Input, Textarea, Select, Label
- Layout: Card, Sheet, Dialog
- Feedback: Badge
- Navigation: Dropdown Menu
- Form Management: Form (React Hook Form integration)
Feature Components
Domain-specific components that compose UI primitives:- Hero: Landing section with animated background and CTA buttons
- Projects: Project showcase with carousel and filtering
- GitHub Stats: Real-time GitHub statistics with animated numbers
- Contact: Form with validation and email integration
- About: Personal information and skills display
Utility Components
- Squares: Canvas-based animated grid background
- AnimatedNumber: Smooth number animation component
- Background: Gradient background effects
Design System
Radix UI Foundation
All UI components are built on Radix UI primitives, providing:Accessibility
ARIA-compliant components with keyboard navigation and screen reader support out of the box
Unstyled Primitives
Headless components that give full control over styling with Tailwind CSS
Composability
Small, focused components that can be composed into complex UI patterns
Type Safety
Full TypeScript support with proper type inference
Styling Approach
Components use a consistent styling strategy:- Tailwind CSS: Utility-first CSS framework for rapid UI development
- class-variance-authority (CVA): Type-safe variant management
- cn() utility: Conditional className merging with
clsxandtailwind-merge
src/components/ui/button.tsx
Component Composition Patterns
Compound Components
Many components follow the compound component pattern for flexibility:Slot Pattern
Components use Radix’sSlot component for polymorphic behavior:
Data Attribute Pattern
Components use data attributes for CSS selectors and state management:Animation Strategy
The portfolio uses Framer Motion for animations:Hero Animation Config
Type Safety
All components are fully typed with TypeScript:- React.ComponentProps: Type extraction from HTML elements
- VariantProps: CVA variant type inference
- Generic Components: Type-safe form components with React Hook Form
Next Steps
UI Components
Explore the complete UI component library with usage examples
Animated Background
Learn about the canvas-based animated grid system
GitHub Stats
Understand the GitHub statistics integration