# Import on Demand (Tree Shaking)
Naive UI supports tree shaking for components, locales and themes.
By default the component theme is light, locale is enUS, and no extra imports are needed.
For more info about theming, see [Customizing Theme](customize-theme).
## Import Directly
```html
```
## Auto Import
You can use the `unplugin-auto-import` plugin to automatically import APIs.
If you develop using SFC, you can use the `unplugin-vue-components` plugin to automatically import components on demand.The plugin will automatically parse the components used in the template and import the components.
```ts
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
// vite.config.ts
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
AutoImport({
imports: [
'vue',
{
'naive-ui': [
'useDialog',
'useMessage',
'useNotification',
'useLoadingBar'
]
}
]
}),
Components({
resolvers: [NaiveUiResolver()]
})
]
})
```
## Install on Demand Globally
```js
import {
// create naive ui
create,
// component
NButton
} from 'naive-ui'
import { createApp } from 'vue'
const naive = create({
components: [NButton]
})
const app = createApp()
app.use(naive)
```
After the installation, you can use the components you installed in SFC like this.
```html
naive-ui
```