Overview
Form components provide the user interface for editing different sections of a CV. Each form component handles its own section of theCVData structure using React Hook Form.
Source Files
- PersonalDetailsForm:
components/forms/PersonalDetailsForm.tsx - ExperienceForm:
components/forms/ExperienceForm.tsx - EducationForm:
components/forms/EducationForm.tsx - ProjectsForm:
components/forms/ProjectsForm.tsx - SkillsForm:
components/forms/SkillsForm.tsx - AchievementsForm:
components/forms/AchievementsForm.tsx - LanguagesForm:
components/forms/LanguagesForm.tsx - ReferencesForm:
components/forms/ReferencesForm.tsx
Common Patterns
All form components follow consistent patterns:- Form Context: Access form methods via
useFormContext<CVData>() - Field Arrays: List-based sections use
useFieldArrayfor dynamic items - Controllers: Form fields wrapped in
Controllerfor controlled components - Section Visibility: Check
hiddenSectionsto determine if section is hidden - Drag & Drop: Reorderable items use Framer Motion’s
Reordercomponents
PersonalDetailsForm
Edits personal information and professional summary.Usage
Props
Current template ID to determine feature availability (e.g., profile image support)
Fields
The form manages the following fields underpersonalInfo:
User’s full name
Professional job title or desired position
Email address
Phone number
Location or full address
LinkedIn profile URL
GitHub profile URL
Personal website or portfolio URL
Professional summary or career objective (multi-line text)
Profile image URL (only shown for templates that support profile images)
Profile Image Support
Profile image upload is conditionally rendered based on template capabilities:rhyhorn, nexus
Example
ExperienceForm
Manages work experience entries with collapsible items.Usage
Props
No props required. Uses form context.Fields
Each experience item contains:Unique identifier (auto-generated)
Company or organization name
Job title or role
Start date (format: MM/YYYY)
End date (format: MM/YYYY or “Present”)
Whether this is the current position
Job responsibilities and achievements (multi-line, bullet points supported)
Features
- Drag & Drop: Reorder items using drag handle
- Collapsible: Items can be expanded/collapsed
- Auto-expand: New items automatically expand
- Empty State: Shows helpful message when no items exist
Reordering
EducationForm
Manages education and certification entries.Usage
Fields
Each education item contains:Unique identifier (auto-generated)
School or university name
Degree, diploma, or certification name
Start date (format: MM/YYYY)
End date or expected graduation (format: MM/YYYY)
Additional details (optional)
Example
ProjectsForm
Showcase personal or professional projects.Usage
Fields
Each project item contains:Unique identifier (auto-generated)
Project name or title
Project date or time period
Technologies used (displayed as “Skill: …” in CV)
Project description and outcomes
SkillsForm
Manage technical and professional skills.Usage
Fields
Each skill item contains:Unique identifier (auto-generated)
Skill name or category (e.g., “Programming Languages”)
Skill values or details (e.g., “JavaScript, Python, Java”)
Skill category:
technical: Technical skillsprofessional: Professional attributes
Category Selection
AchievementsForm
Track awards, certifications, and recognition.Usage
Fields
Each achievement item contains:Unique identifier (auto-generated)
Achievement or award title
Issuing organization or institution
Date received or achieved
LanguagesForm
List languages and proficiency levels.Usage
Fields
Each language item contains:Unique identifier (auto-generated)
Language name
Proficiency level (e.g., “Native”, “Fluent”, “Conversational”)
ReferencesForm
Simple text field for references section.Usage
Fields
References text (typically “Available upon request” or contact details)
Shared Components
FormSectionCard
All form components are wrapped inFormSectionCard for consistent styling:
Collapsible Items
List-based forms use a common collapsible item pattern:Validation
Forms use React Hook Form’s built-in validation:Accessibility
- Labels: All form fields have associated labels
- Required Fields: Marked with asterisk and aria-required
- Error Messages: Announced to screen readers
- Keyboard Navigation: Full keyboard support for all interactions
- Focus Management: Focus moves to fields when sections expand
Related Components
- CVBuilder - Main component that uses these forms
- Preview Components - Display formatted CV data
- Templates - Template-specific rendering