Vueless Docs
ComponentsGitHubWebsite
  • Installation
    • Quick start (Vue)
    • Quick start (Nuxt)
    • Class autocompletion
    • Minimal requirements
    • Storybook docs
  • Global customization
    • General
    • Colors
    • Rounding
    • Focus Outline
    • Dark mode
    • Base Classes
    • Custom tailwind classes
  • Component customization
    • General
    • Styling
    • Conditional styling
    • Extends styling from keys
    • Nested components styling
    • Classes smart merging
    • Props defaults
    • Redefining props
    • Defining custom props
    • Internationalization (i18n)
  • Creating own components
    • Vueless file structure
    • Create new component
    • Copy existing component
  • Svg Icons
    • General usage
    • Custom icons
    • Dynamic import
    • Advanced settings
  • Helpers
    • Change settings in runtime
Powered by GitBook
On this page
  • πŸ“ U[component]/
  • πŸ“ storybook/
  • πŸ“œ config.ts
  • πŸ“œ constants.ts
  • πŸ“œ types.ts
  • πŸ“œ U[component].test.ts
  • πŸ“œ U[component].vue
  • πŸ“œ U[component][child].vue (optional)
  • πŸ“œ use[composable].ts (optional)
  • πŸ“œ util[service].ts (optional)
  1. Creating own components

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
β”œβ”€ config.ts
β”œβ”€ constants.ts
β”œβ”€ types.ts
β”œβ”€ U[component].test.ts
β”œβ”€ U[component].vue
β”‚  # optional
β”œβ”€ U[component][child].vue
β”œβ”€ ... # rest child components
β”œβ”€ use[composable].ts
β”œβ”€ ... # rest composable
β”œβ”€ util[service].ts
└─ ... # rest utils
ui.form-date-picker-range/
β”œβ”€ storybook/
β”‚  β”œβ”€ docs.mdx
β”‚  └─ stories.ts
β”œβ”€ config.ts
β”œβ”€ constants.ts
β”œβ”€ types.ts
β”œβ”€ UDatePickerRange.test.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 – custom component docs page.

  • πŸ“œ stories.ts – component stories.

πŸ“œ 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].test.ts

Contains unit tests for the component. We recommend using vitest with @vue/test-utils for testing.

πŸ“œ 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 2 months ago