@pixela/voxel-ui-nuxt
@pixela/voxel-ui-nuxt
Nuxt module for @pixela/voxel-ui — auto-imports all components and composables, and injects the design-token CSS.
Install
npm install @pixela/voxel-ui-nuxt @pixela/voxel-ui
Setup
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@pixela/voxel-ui-nuxt'],
})
That's it — components and composables are auto-imported and CSS is injected automatically.
Usage
Components are auto-imported with a Vx prefix:
<template>
<VxButton color="primary">Save</VxButton>
<VxDialog title="Confirm" description="Are you sure?">
<template #trigger><VxButton>Open</VxButton></template>
</VxDialog>
</template>
Composables are auto-imported too:
const { theme, setTheme } = useTheme()
const toast = useToast()
const sidebar = useSidebar()
Naming note: the Nuxt module registers local names with a
Vxprefix (VxButton), while the underlying@pixela/voxel-uibarrel exports use an all-capsVXprefix (VXButton). Use<VxButton />in Nuxt templates andVXButtonfor direct imports.
Options
Configure via the voxel key in nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@pixela/voxel-ui-nuxt'],
voxel: {
prefix: '', // prepended to component names
components: true, // set false to disable component auto-import
theme: '~/assets/theme.css', // extra CSS injected after tokens
},
})
| Option | Type | Default | Description |
|---|---|---|---|
prefix |
string |
'' |
Prepended to auto-imported component names (e.g. 'Ui' → <UiVxButton>) |
components |
boolean |
true |
Enable component auto-import |
theme |
string |
undefined |
Path to extra CSS loaded after the token stylesheet |
License
MIT
Related Packages
Provides a design token-powered UI component library and styling system for Nuxt...
Nuxt 4 module for @7pmlabs/design-system — auto-imports components, composables,...
Nuxt module for easily integrating Solar Icons into your Nuxt 3+ applications.
Nuxt module for vuecs — auto-imports @vuecs/design tokens and ships SSR-safe col...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.6.1 | ^3.0 | MIT | |
| 0.6.0 | ^3.0 | MIT | |
| 0.5.0 | ^3.0 | MIT | |
| 0.4.2 | ^3.0 | MIT | |
| 0.4.1 | ^3.0 | MIT | |
| 0.4.0 | ^3.0 | MIT | |
| 0.3.0 | ^3.0 | MIT | |
| 0.2.0 | ^3.0 | MIT | |
| 0.1.0 | ^3.0 | MIT |