This document is for AI agents working inside Vue projects that consume GNexus UI Kit.
The Vue adapter is the primary contract for Vue projects. Always use gnexus-ui-kit/vue components instead of writing raw kit markup by hand.
Do not recreate modal, drawer, tab, toast, form, button, or table markup manually unless the adapter does not expose the needed component yet. Raw classes are acceptable only for layout wrappers and content that has no Vue adapter component.
At app root:
import "gnexus-ui-kit/dist/css/kit.css"; import "gnexus-ui-kit/dist/assets/fonts/phosphor-icons/src/css/icons.css";
Use named imports:
import { GnButton, GnInput, GnModal } from "gnexus-ui-kit/vue";
Or global registration:
import { GnexusUiVue } from "gnexus-ui-kit/vue";
app.use(GnexusUiVue);
Use these mappings:
GnButtonGnIconButtonGnCopyButtonGnBadgeGnAlertGnCardGnHorizontalCardGnLoginCardGnPageHeaderGnInputGnTextareaGnSelectGnCheckbox or GnSwitchGnRadio or GnRadioGroupGnRangeGnFileUploadGnComboboxGnTabsGnRouterTabsGnAccordionGnModalGnDrawerGnToastProvider + useToastGnConfirmDialogGnTableGnToolbarGnInputGroupGnSearchFieldGnPaginationGnEmptyStateGnSkeletonGnDescriptionListGnProgressGnUsageMeterGnProgressStagesGnStepsGnChip, GnChipGroupGnAvatar, GnIdentity, GnAvatarStackGnTimeline, GnActivityLogGnList, GnDefinitionList, GnActionListGnLoaderGnStatusCard, GnMetricCard, GnActionCardGnDropdownGnPopoverGnTooltipGnNavListGnNavigationShellGNexusUIKit.Modals.create() from Vue components.GNexusUIKit.Overlays.init() or GNexusUIKit.NavigationShell.init() in Vue projects.Accordion.init() or Tabs.init() inside Vue components.advancedSelect() helper in Vue; use GnCombobox.InputPatterns.init() for Vue file upload previews; use GnFileUpload.ph- prefix (e.g. icon="house" is wrong; use icon="ph-house").icon prop.Raw classes are acceptable for layout-only wrappers and content that has no Vue adapter yet:
<div class="form-grid">...</div> <div class="demo-actions">...</div>
For interactive components, add or extend the adapter first.
When the base kit changes markup for a component, update the Vue adapter in this repository. Downstream projects should receive compatibility through dependency updates, not local rewrites.
Before claiming Vue adapter compatibility, run:
npm run build npm run test:vue-adapter
Warnings about /assets/fonts/... in Vite builds are expected with the current CSS contract. They mean the host app must serve GNexus UI Kit assets at /assets.
The local example clears examples/vue/node_modules/.vite before build because gnexus-ui-kit is linked from the repository root and Vite can otherwise reuse stale optimized metadata after dist/vue changes.
GnModal and GnDrawer handle Escape, focus return, and Tab focus trapping.GnToastProvider is single-toast by design: a new toast replaces the current one.GnCombobox owns combobox/listbox ARIA and keyboard movement.GnFileUpload owns preview object URLs and cleans them up on remove/unmount.GnRouterTabs drives active state from the current vue-router route and calls router.push() on tab activation. Requires vue-router in the host app.GnNavList detects item.to (router target) and renders accessible links with resolved href. If vue-router is present, clicking navigates via the router and active state is computed from the current route.