Vueless file structure
All Vueless components follow a consistent file structure. We recommend adopting this structure when creating your own local components to ensure maintainability and consistency.
U[component]/
ββ storybook/
β ββ docs.mdx
β ββ stories.ts
ββ tests/
β ββ U[component].test.ts
β ββ util[service].test.ts
β ββ use[composable].test.ts
β ββ ... # rest tests
ββ config.ts
ββ constants.ts
ββ types.ts
ββ U[component].vue
β # optional
ββ U[component][child].vue
ββ ... # rest child components
ββ use[composable].ts
ββ ... # rest composable
ββ util[service].ts
ββ ... # rest utilsui.form-date-picker-range/
ββ storybook/
β ββ docs.mdx
β ββ stories.ts
ββ tests/
β ββ UDatePickerRange.test.ts
β ββ UDatePickerRangeInputs.test.ts
β ββ UDatePickerRangePeriodMenu.test.ts
β ββ ... # rest tests
ββ config.ts
ββ constants.ts
ββ types.ts
ββ UDatePickerRange.vue
ββ UDatePickerRangeInputs.vue
ββ UDatePickerRangePeriodMenu.vue
ββ useLocale.ts
ββ useUserFormat.ts
ββ utilDateRange.ts
ββ utilValidation.tsπ U[component]/
Each component should be contained within a single folder, maintaining a flat file structure. All component names must be prefixed with U to ensure proper recognition by Vueless.
π storybook/
Folder for Storybook-related files:
π docs.mdx β component docs page.
π stories.ts β component stories.
π tests/
Folder for test-related files:
π U[component].test.ts β component tests.
π util[service].test.ts β component utility service tests. (optional)
π use[composable].test.ts β component composable tests. (optional)
We recommend using vitest with @vue/test-utils for testing
π config.ts
Contains all styles, default prop values, internationalization (i18n), and other component-specific settings.
π constants.ts
Contains component constants.
π types.ts
Contains component types and props declaration.
π U[component].vue
Parent Vue component.
π U[component][child].vue (optional)
A child Vue component used within the parent component. The parent component may have multiple child components, all prefixed with the parent componentβs name.
Example: UButtonIcon.vue (child of UButton.vue).
π use[composable].ts (optional)
Composables specific to the component. A component may have multiple composables, all prefixed with use keyword, following Vue conventions.
π util[service].ts (optional)
Utils, services and helpers specific to the component. A component may have multiple composables, all prefixed with util keyword.
Last updated