# @nyxwire/vue 0.1.1 Nyxwire's Vue 3 components: accessible families built on Reka UI and Tailwind CSS v4, in an indigo neon identity. `@nyxwire/vue` is a Vue 3 component library built on [Reka UI](https://reka-ui.com/), the headless primitives that provide keyboard support, focus management and ARIA. Every component is styled with the Nyxwire Tailwind theme, so it matches the corresponding `nw-*` CSS class and follows the flavor and accent of its scope. _Live example: [Vue overview](https://nyxwire.dissidence.ovh/vue/)._ This is `NwFlavorSelect` driven by `useFlavor()`, hydrated as an Astro island. Change it and the header picker follows, because both talk to the same page runtime. ## Conventions - Every export is prefixed `Nw`, and compound components mirror Reka's anatomy: `NwSelect`, `NwSelectTrigger`, `NwSelectContent`, `NwSelectItem`. - Components that wrap a Reka primitive forward its props and events, so `v-model`, `as-child` and the Reka options work as Reka documents them. - Styled components share the appearance props of the CSS classes: `intent` (`primary`, `secondary`, `tertiary`, `neutral`, `info`, `success`, `warning`, `danger`), `variant` (`solid`, `soft`, `outline`, `ghost`, `link`) and `size` (`xs` to `lg`), plus the Nyxwire motifs `cut` (chamfered corners), `wire` (gradient edge) and `glow` (`sm`, `md`, `lg`). - Every component that takes `class` merges it with [`cn()`](https://nyxwire.dissidence.ovh/tailwind/merging/), so your utilities replace the component's own instead of fighting them. - Popups (select lists, menus, popovers, tooltips, dialogs, toasts) render in the page through Reka portals, never as browser-drawn popups. ## Install 1. Install the components, the Tailwind theme they are styled with, and Tailwind. ```sh pnpm add @nyxwire/vue @nyxwire/tailwind vue pnpm add -D tailwindcss @tailwindcss/vite @vitejs/plugin-vue ``` Reka UI, tailwind-variants, tailwind-merge, `@lucide/vue`, `@vueuse/core` and `@internationalized/date` are dependencies of the package; Vue 3.5 or later and Tailwind CSS 4 are peer dependencies. Add `@lucide/vue` to your own dependencies too if your code imports [icons](foundations/icons.md). 2. Register the Vue and Tailwind plugins. ```ts title="vite.config.ts" import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import tailwindcss from '@tailwindcss/vite' export default defineConfig({ plugins: [vue(), tailwindcss()] }) ``` 3. Import Tailwind, the theme, and the component sources in your stylesheet. ```css title="src/style.css" @import 'tailwindcss'; @import '@nyxwire/tailwind'; @import '@nyxwire/vue/tailwind.css'; ``` The second line brings the tokens, the four flavors and the bundled fonts. The last line is an `@source` for the package's built files, so Tailwind generates every class the components use. The components do not need the plain `@nyxwire/css` component classes. 4. Wrap the app in `NwProvider` and set a flavor on ``. ```vue title="src/App.vue" ``` ```html title="index.html" ``` ## Plugin or named imports Import components where you use them. The package ships one ES module per component and marks only its CSS as a side effect, so a bundler keeps just what you import: ```ts import { NwSelect, NwSelectContent, NwSelectItem, NwSelectTrigger, NwSelectValue, } from '@nyxwire/vue' ``` `NyxwirePlugin` registers every `Nw*` component globally instead. It suits prototypes; it also pulls every component into the bundle. ```ts title="src/main.ts" import { createApp } from 'vue' import { NyxwirePlugin } from '@nyxwire/vue' import App from './App.vue' import './style.css' createApp(App).use(NyxwirePlugin).mount('#app') ``` ## Flavors in Vue `useFlavor()` reads and sets the flavor: it returns `flavor` (the preference, `auto` included), `resolvedFlavor`, `isDark`, `flavors` and `setFlavor()`. It shares the `nyxwire-flavor` storage key and the `nyxwire:flavor` event with every other package; [Flavors & theming](foundations/flavors.md#vue-useflavor) covers the composable and its options. `NwFlavorSelect` is its picker: a labelled native `