The`components/`directory is where you put all your Vue components which can then be imported inside your pages or other components ([learn more](https://vuejs.org/guide/essentials/component-basics.html#components-basics)).
... then the component's name will be based on its own path directory and filename, with duplicate segments being removed. Therefore, the component's name will be:
For clarity, we recommend that the component's file name matches its name. (So, in the example above, you could rename `Button.vue` to be `BaseFooButton.vue`.)
If you want to use the Vue `<component :is="someComputedComponent">` syntax, then you will need to use the `resolveComponent` helper provided by Vue.
For example:
```vue
<template>
<component:is="clickable ? MyButton : 'div'"/>
</template>
<scriptsetup>
const MyButton = resolveComponent('MyButton')
</script>
```
Alternatively, though not recommended, you can register all your components globally, which will create async chunks for all your components and make them available throughout your application.
```diff
import { defineNuxtConfig } from 'nuxt3'
export default defineNuxtConfig({
components: {
+ global: true,
+ dirs: ['~/components']
},
})
```
::alert{type=info}
The `global` option can also be set per component directory.
This is particularly useful if the component is not always needed. By using the `Lazy` prefix you can delay loading the component code until the right moment, which can be helpful for optimizing your JavaScript bundle size.
Nuxt provides the `<ClientOnly>` component for purposely rendering a component only on client side. To import a component only on the client, register the component in a client-side only plugin.