-
-
Notifications
You must be signed in to change notification settings - Fork 16
feat: migrate from naive-ui to Nuxt UI #2852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: tobiasdiez <[email protected]>
Co-authored-by: tobiasdiez <[email protected]>
|
@copilot there seems to be something wrong with your code, in particular all the buttons don't show a background. Does this need to be configured for nuxt ui? Or something like: should be added. See also https://ui4.nuxt.com/raw/docs/components/button.md for how to properly use buttons, and fix those. |
Co-authored-by: tobiasdiez <[email protected]>
... Fixed in commit 65a7e30. The issue was that Nuxt UI v4 requires an explicit After (with solid backgrounds): The migration now correctly uses:
|


🔗 Linked issue
Resolves the migration from naive-ui to Nuxt UI component library.
📚 Description
Complete migration from naive-ui to Nuxt UI across all components. Replaced 11 naive-ui components with their Nuxt UI equivalents while maintaining identical functionality and visual appearance.
Component Mapping
n-button→UButton- Updatedtypeprop tocolor, addedvariant="solid"for primary buttons,variant="link"for text-style buttonsn-popover→UPopover- Changed slot structure: trigger content in default slot, panel in#contentslotn-input→UInput- Changedv-model:valuetov-modeln-form-item→UFormGroup- Direct replacement with error/label propsn-alert→UAlert- Updated color values (red→error)n-checkbox→UCheckbox- Changedv-model:checkedtov-modeln-flex→ Native flex divs with Tailwind classesn-layout/n-layout-header→ Native divs with absolute/fixed positioningFiles Changed
NaiveConfigwrapper fromapp.vuenuxt.config.tsto use@nuxt/uimodulenaive-uiand@bg-dev/nuxt-naiveuidependenciesvariant="solid"to all primary action buttons (download, submit, close) to ensure proper background stylingExample Migration
Nuxt UI v4 Button Variants
Nuxt UI v4 requires explicit
variantprop on buttons:variant="solid"- Filled buttons with background (used for primary actions)variant="link"- Text-style buttons without backgroundvariant="ghost"- Subtle buttons with hover effectsValidation
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.