# Component Structure ## Component folders Prefer giving non-trivial components their own folder: ``` components/ └── analytics-chart/ ├── index.vue ├── analytics-chart-header.vue ├── analytics-chart-plot.vue ├── analytics-chart-data.ts └── use-analytics-chart.ts ``` The folder name should match the public component name in kebab case. The main component in that folder should be `index.vue`. This keeps imports short: ```ts import AnalyticsChart from '@/components/analytics-chart/index.vue' ``` If the local resolver supports directory indexes, importing the folder is also fine: ```ts import AnalyticsChart from '@/components/analytics-chart/' ``` Use the explicit `index.vue` import when the TypeScript setup cannot resolve the directory import reliably. ## Local implementation files Keep files that only exist to support one component inside that component's folder: ``` analytics-chart/ ├── index.vue ├── analytics-chart-header.vue ├── analytics-chart-plot.vue ├── analytics-chart-tooltip.vue ├── chart-ranges.ts └── use-chart-hover-state.ts ``` Good candidates for local files: - Small subcomponents used only by the main component - Local composables used only by the main component or its local subcomponents - Helpers that split up a large `