beautyline-component-structure
File and folder naming, barrel exports, and import paths for React components in the Beautyline webapp. Use when adding components, renaming files, or choosing between admin vs marketing folder conven
SKILL.md.cursor/skills/beautyline-component-structure/SKILL.md
GitHubBeautyline: component structure
Default pattern (marketing / shared sections)
- Folder: PascalCase matching the feature or component concept (e.g.
AcademicPathsSection,CourseDetailView). - Main file: kebab-case
.tsx(e.g.academic-paths-section.tsx,course-detail-view.tsx). - Export: Named export matching the PascalCase component name.
Admin and small utilities
- Under
src/components/admin/,PascalCase.tsxfilenames are acceptable and already used (CourseTypeSelect.tsx,ImageUpload.tsx). Keep this area consistent with existing neighbors in the same folder.
Barrel index.ts
- Some feature folders expose a public API via
index.ts(CourseDetailView/index.ts). Add a barrel when multiple files coexist in one folder and importers should import from@/components/FeatureNamewithout reaching into internal filenames. - If the folder contains only one main component file, a barrel is optional unless re-exports consolidate subcomponents used outside the folder.
Imports
- Use
@/components/...and@/lib/...— avoid deep relative chains like../../../when crossingsrc/boundaries.
Naming alignment
- Props:
interface ComponentNamePropsin the component file (ComponentNameProps, not genericPropsat module scope unless the file exports a single component).