Vue File Naming Conventions
Unique Component Names
Vue component file names must be unique and descriptive within the app to make them easily identifiable.
Good Examples:
✅ ClientOverview.vue (not Overview.vue)
✅ ClientFinancingTab.vue (not FinancingTab.vue)
✅ DailyRegistrationForm.vue (not Form.vue)
✅ UserProfileCard.vue (not ProfileCard.vue)
Bad Examples:
❌ Overview.vue (too generic)
❌ Tab.vue (what kind of tab?)
❌ Form.vue (which form?)
❌ Card.vue (what card?)Naming Pattern
Pattern: [Domain/Context][Purpose][Type].vue
- Domain/Context: The main feature or domain (Client, User, DailyRegistration, etc.)
- Purpose: What it does (Overview, Details, Edit, etc.)
- Type: Component type (Page, Modal, Form, Card, etc.) - optional but helpful
Examples:
ClientOverviewPage.vue- Client overview pageClientEditModal.vue- Modal to edit a clientDailyRegistrationCreateForm.vue- Form to create daily registrationUserProfileCard.vue- Card displaying user profile
Page Components (Mandatory Domain Prefix)
All page components in pages/ directories must be prefixed with their domain name. This is a strict convention.
Rules:
- Convert domain folder name to PascalCase
- Hyphenated domains:
ambulatory-schedule→AmbulatorySchedule - For subdomains, use the subdomain name as prefix
- No generic names like
Overview.vue,Create.vue,Edit.vue
| Domain Path | ✅ Correct | ❌ Incorrect |
|---|---|---|
domains/client/pages/ | ClientOverview.vue | Overview.vue |
domains/mdo/pages/ | MdoOverview.vue | Overview.vue |
domains/settings/mentor-type/pages/ | MentorTypeCreate.vue | Create.vue |
domains/schedule/ambulatory-schedule/pages/ | AmbulatoryScheduleOverview.vue | Overview.vue |
domains/client/tabs/evaluation/pages/ | EvaluationShow.vue | ShowEvaluation.vue |
Generic Shared Components
Only shared components can have generic names if they're truly reusable:
✅ PrimaryButton.vue (in shared/components/buttons/)
✅ Badge.vue (in shared/components/badges/)
✅ Column.vue (in shared/layouts/columns/)