Skip to content
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

v3 #1289

Open
44 tasks done
benjamincanac opened this issue Jan 29, 2024 — with Volta.net · 225 comments
Open
44 tasks done

v3 #1289

benjamincanac opened this issue Jan 29, 2024 — with Volta.net · 225 comments
Assignees
Labels

Comments

Copy link
Member

benjamincanac commented Jan 29, 2024

The development is ongoing on the default branch of this repository: https://github.com/nuxt/ui.


A lot has changed since @nuxt/ui was made open-source (May 2023), so the plan here is to rewrite every component from scratch alongside their config.

I'll post regular updates on this issue and on https://twitter.com/benjamincanac.

Documentation

https://ui3.nuxt.dev

Roadmap (Nov 20, 2024)

  • Finish the migration to reka-ui@alpha on @nuxt/ui & @nuxt/ui-pro (feat(module)!: migrate to reka-ui #2448)
  • Write the docs for implemented @nuxt/ui-pro components
  • Finish @nuxt/ui-pro components (almost all are done except for Dashboard)
  • Make Nuxt UI Pro v3 work with Vue like Nuxt UI
  • Implement new components in @nuxt/ui like Calendar (feat(Calendar): implement component #2618), DateInput, Tree (feat(Tree): implement component #2757), Stepper (feat(Stepper): new component #2733), etc.
  • Migrate all the Nuxt UI Pro templates (starter, landing, docs, saas and dashboard)
  • Write a complete migration guide
  • Build the Nuxt UI docs marketing pages (landing, pricing, templates, etc.)
  • Migrate all the Nuxt apps (nuxt.com, image.nuxt.com, eslint.nuxt.com, devtools.nuxt.com, fonts.nuxt.com, hub.nuxt.com, nuxt.studio, etc.)
  • Release @nuxt/ui & @nuxt/ui-pro officially once tailwindcss and reka-ui are released
  • Make new @nuxt/ui-pro components & templates like Changelog, Portfolio, etc.

Breaking Changes

The biggest change is the switch to tailwind-variants, this will cause lots of breaking changes if you've used the ui prop or app.config.ts to override the config. I apologize in advance for this but I strongly believe this will be beneficial and will bring consistency across all components.

At the beginning the config was split in many keys for the same div to give more flexibility, but since then we introduced tailwind-merge which now allows us to group those keys together, this is a good opportunity to clean the whole thing.

The config will now have a slots amongst other keys that will specifically target dom nodes. The ui prop will only allow you to target those slots.

These changes alongside the refactor of all components will also improve the types, the app.config.ts and ui props are now perfectly typed, as well as all components props, slots, emits and expose.

Feel free to comment on this if you have any ideas for the next major.

Components

@benjamincanac benjamincanac added the v3 #1289 label Jan 29, 2024 — with Volta.net
@benjamincanac benjamincanac pinned this issue Jan 29, 2024
@benjamincanac benjamincanac added release and removed v3 #1289 labels Jan 29, 2024
@benjamincanac benjamincanac changed the title Major v3.0 release v3.0 release Jan 29, 2024
@benjamincanac benjamincanac changed the title v3.0 release Next v3.0 release Jan 29, 2024
@sandros94
Copy link
Collaborator

I would like to help, if I'm able to. Is there going to be a dedicated branch or will it be done in the dev one?

Copy link
Member Author

Once we start this, there will be indeed a new branch with auto-release so we can try it out and especially keep working on the v2 as it might take some time. I'll create new issues once this gets started with the remaining things to do 😊

@jd-solanki
Copy link

Hi @benjamincanac

I have few design ideas if you are open to this I would like to share it for the future of Nuxt UI 3. Should we discuss this in this issue or it'll be better to discuss design ideas in seperate discussion thread?

Copy link
Member Author

@jd-solanki You can share them here!

@benjamincanac benjamincanac changed the title Next v3.0 release v3.0 Mar 4, 2024
@sawa-ko
Copy link

sawa-ko commented Mar 5, 2024

Since it is supposed to be a refactoring to all components, could we give the possibility of compatibility with unocss?

Copy link
Member Author

benjamincanac commented Mar 6, 2024

@sawa-ko It will be made with Tailwind v4. To what end would you make it compatible with Uno?

@benjamincanac benjamincanac self-assigned this Mar 6, 2024
Copy link
Member Author

benjamincanac commented Mar 6, 2024

I've started working on this in a private repository of mine, I'll open-source it once I'm satisfied with the base so you guys can check it out 😊.

A lot has changed since @nuxt/ui was made open-source (May 2023), so the plan here is to rewrite every component from scratch alongside their config. For example, at the beginning the config was split in many keys for the same div to give more flexibility, but since then we introduced tailwind-merge which now allows us to group those keys together.

I'll post regular updates on this issue.

@ghost
Copy link

ghost commented Mar 8, 2024

Please tell me how long it will take for this upgrade to be available.
Very much looking forward to this upgrade

Copy link
Member Author

I have no idea how long it will take and it's not entirely up to us, I hope to release it at the same time as the official release of Tailwind v4.

@robin-dongbin
Copy link

That's awesome. The new version of nuxt-ui uses exactly the tech stack I expected.

I tried to build my own UI library using radix-ui and tailwind-variants, but I immediately found that even with radix-ui, it is not easy to build a full UI library.

But I got an idea with an API that works with any design language. If you are interested, here is my demo repository:
https://github.com/vincajs/vinca-ui

Copy link
Member Author

@robin-dongbin It's already in the making. There are already 13 components done, 36 more to go 😅

@robin-dongbin
Copy link

Since the component library is based on radix-ui without styles, I thought it would be nice to provide an api that is abstracted from various design systems, so you can switch styles from one system to another at any time.

If people want to implement another design system, they can just customize it, share files, or even contribute to a repository.

Taking things a step further, it is possible to switch between different design systems at runtime.

Of course, I'm just offering an idea, and if you think it's too late, that's fine

Copy link
Member Author

This is actually already what we're doing with the App Config. You can customize the classes for every part of every component.

@aspitrine
Copy link

Thanks for the work!
i’m impatient to try this!

Just one question :

The biggest change is the switch to tailwind-variants, this will cause lots of breaking changes if you've used the ui prop or app.config.ts to override the config.

app.config.ts is deprecated and it will not port in v3? Or it’s something else?

Copy link
Member Author

No we keep the app.config.ts, what I meant is since we now use tailwind-variants the config itself changes.

For example the Kbd component, its config looked like this:

export default {
  base: 'inline-flex items-center justify-center text-gray-900 dark:text-white',
  padding: 'px-1',
  size: {
    xs: 'h-4 min-w-[16px] text-[10px]',
    sm: 'h-5 min-w-[20px] text-[11px]',
    md: 'h-6 min-w-[24px] text-[12px]'
  },
  rounded: 'rounded',
  font: 'font-medium font-sans',
  background: 'bg-gray-100 dark:bg-gray-800',
  ring: 'ring-1 ring-gray-300 dark:ring-gray-700 ring-inset',
  default: {
    size: 'sm'
  }
}

Here is the new version:

export default {
  base: 'inline-flex items-center justify-center text-gray-900 dark:text-white px-1 rounded font-medium font-sans bg-gray-50 dark:bg-gray-800 ring ring-gray-300 dark:ring-gray-700 ring-inset',
  variants: {
    size: {
      xs: 'h-4 min-w-[16px] text-[10px]',
      sm: 'h-5 min-w-[20px] text-[11px]',
      md: 'h-6 min-w-[24px] text-[12px]'
    }
  },
  defaultVariants: {
    size: 'sm'
  }
}

This is a breaking change if you've overridden its config in your app.config.ts or through the ui prop. I'm thinking of a CLI or something that would help people migrate from v2 to v3 without too much trouble but it might not be easy to achieve. Everything is fully typed so this will give some indications at least.

@aspitrine
Copy link

Ok !

Effectively, it's a breaking change but it seam ok for the future to have a better granularity with the variants.

Thanks for the explanation and the example 🙏🏻

@hywax
Copy link
Collaborator

hywax commented Nov 18, 2024

@MickL @rigtigeEmil #2668

@MickL
Copy link

MickL commented Nov 18, 2024

Yes some components have this abbility but there is no standalone component

@spencerjsmall
Copy link

Hey! Loving v3 so far. Any timeline for when Pro v2 docs will be out?

Copy link
Member Author

benjamincanac commented Nov 20, 2024

They will be coming soon!

Here is my roadmap for the coming months while maintaining both Nuxt UI v2/v3 and Nuxt UI Pro v1/v3:

  1. Finish the migration to reka-ui@alpha on @nuxt/ui & @nuxt/ui-pro
  2. Write the docs for implemented @nuxt/ui-pro components
  3. Finish @nuxt/ui-pro components (almost all are done except for Dashboard)
  4. Make Nuxt UI Pro v3 work with Vue like Nuxt UI
  5. Implement new components in @nuxt/ui like Calendar, DateInput, DatePicker, Tree, Stepper, etc.
  6. Migrate all the Nuxt UI Pro templates (starter, landing, docs, saas and dashboard)
  7. Write a complete migration guide
  8. Build the Nuxt UI docs marketing pages (landing, pricing, templates, etc.)
  9. Migrate all the Nuxt apps (nuxt.com, image.nuxt.com, eslint.nuxt.com, devtools.nuxt.com, fonts.nuxt.com, hub.nuxt.com, nuxt.studio, etc.)
  10. Release @nuxt/ui & @nuxt/ui-pro officially once tailwindcss and reka-ui are released
  11. Make new @nuxt/ui-pro components & templates like Changelog, Portfolio, etc.

@ikxin
Copy link

ikxin commented Nov 20, 2024

They will be coming soon!

Here is my roadmap for the coming months while maintaining both Nuxt UI v2/v3 and Nuxt UI Pro v1/v3:

  1. Finish the migration to reka-ui@alpha on @nuxt/ui & @nuxt/ui-pro
  2. Write the docs for implemented @nuxt/ui-pro components
  3. Finish @nuxt/ui-pro components (almost all are done except for Dashboard)
  4. Implement new components in @nuxt/ui like Calendar, DateInput, DatePicker, Tree, Stepper, etc.
  5. Migrate all the Nuxt UI Pro templates (starter, landing, docs, saas and dashboard)
  6. Write a complete migration guide
  7. Build the Nuxt UI docs marketing pages (landing, pricing, templates, etc.)
  8. Migrate all the Nuxt apps (nuxt.com, image.nuxt.com, eslint.nuxt.com, devtools.nuxt.com, fonts.nuxt.com, hub.nuxt.com, nuxt.studio, etc.)
  9. Release @nuxt/ui & @nuxt/ui-pro officially once tailwindcss and reka-ui are released
  10. Make new @nuxt/ui-pro components & templates like Changelog, Portfolio, etc.

Relatively speaking, I am looking forward to it more https://ui3.nuxt.dev/pro

@twf-nikhila
Copy link

Any progress on using it without nuxtjs? Will purchase pro if it works

@ikxin
Copy link

ikxin commented Nov 21, 2024

Any progress on using it without nuxtjs? Will purchase pro if it works

Nuxt UI can now use it on Vue. For details, please check https://ui3.nuxt.dev/getting-started/installation/vue

@twf-nikhila
Copy link

Any progress on using it without nuxtjs? Will purchase pro if it works

Nuxt UI can now use it on Vue. For details, please check https://ui3.nuxt.dev/getting-started/installation/vue

Awesome, the pro version also works with Vuejs?

@cbalmefrezol
Copy link

@twf-nikhila @ikxin
Be careful, there are some issues with Vue #2518 !
I have the same problem.

Copy link
Member Author

Nuxt UI Pro v3 doesn't work with Vue yet, I have to work on this.

@twf-nikhila
Copy link

Nuxt UI Pro v3 doesn't work with Vue yet, I have to work on this.

@benjamincanac any timeline for when it'll be released?

@MickL
Copy link

MickL commented Nov 21, 2024

They will be coming soon!

Here is my roadmap for the coming months while maintaining both Nuxt UI v2/v3 and Nuxt UI Pro v1/v3:

  1. Finish the migration to reka-ui@alpha on @nuxt/ui & @nuxt/ui-pro
  2. Write the docs for implemented @nuxt/ui-pro components
  3. Finish @nuxt/ui-pro components (almost all are done except for Dashboard)
  4. Make Nuxt UI Pro v3 work with Vue like Nuxt UI
  5. Implement new components in @nuxt/ui like Calendar, DateInput, DatePicker, Tree, Stepper, etc.
  6. Migrate all the Nuxt UI Pro templates (starter, landing, docs, saas and dashboard)
  7. Write a complete migration guide
  8. Build the Nuxt UI docs marketing pages (landing, pricing, templates, etc.)
  9. Migrate all the Nuxt apps (nuxt.com, image.nuxt.com, eslint.nuxt.com, devtools.nuxt.com, fonts.nuxt.com, hub.nuxt.com, nuxt.studio, etc.)
  10. Release @nuxt/ui & @nuxt/ui-pro officially once tailwindcss and reka-ui are released
  11. Make new @nuxt/ui-pro components & templates like Changelog, Portfolio, etc.

Thats a long list! Personally I would appreciate if Nuxt UI is first priority and Nuxt UI Pro comes after everything is finished. This would also assure that v3 is tested well enough before you release Pro v3.

@sandros94
Copy link
Collaborator

Personally I would appreciate if Nuxt UI is first priority and Nuxt UI Pro comes after

Nuxt UI definitely has the priority! Since UI Pro is built on top of it, everything needs to work on UI before being merged and used by UI Pro itself.

But do keep in mind that both projects depend on two separate upstreams (tailwind v4 and reka ui) that are currently in alpha stage. Developing these 4 projects almost in parallel makes spotting and resolving issues much quicker, ending up in a much better beta and stable releases for all.

@ikxin
Copy link

ikxin commented Nov 22, 2024

Tailwind v4 has been in alpha for a long time 😂

@adjabaev
Copy link

Tailwind v4 has been in alpha for a long time 😂

Well the first beta version has been released today 😂

@sharmapukar217
Copy link

sharmapukar217 commented Nov 22, 2024

how to use asChild on <UButton /> component

@simonmaass
Copy link

simonmaass commented Nov 25, 2024

in the latest alpha 9 version i am getting the following error:
Image

Related?
v3.0.0-alpha.8...v3.0.0-alpha.9#diff-d833eb92a175ecf3ef9d742ad99c0d2f6f4efad3037bdc4f8c5dc4e9640f18d3L229
Image

@benjamincanac
Copy link
Member Author

benjamincanac commented Nov 28, 2024

I'm posting this comment here to ask you for help.

With the growing number of issues, I have to choose to spend all my time answering issues to keep the number "reasonable" or actually code to move forward.

So if any of you guys have a bit of spare time to help on issue triage or even if you encounter old issues that aren't relevant anymore and can be closed, please let me know! That would be greatly appreciated 😊

Thank you!

@MickL
Copy link

MickL commented Nov 29, 2024

Sorry for disturbing, but I have two points:

  1. It would be great to have a version switcher on the docs (v2 / v3 alpha). Currently the v3 docs are not linked anywhere and hard to find. Example: https://i18n.nuxtjs.org/docs/getting-started (top left corner)
  2. Please add TypeScript interfaces to the examples in the docs. Currently everything is untyped and it is very cumberstone to find the correct types sometimes. E.g. const links = [ ... ] should become const links: HorizontalNavigationLink[][] | HorizontalNavigationLink[] = [ ... ]
  3. I want to bring back the discussion to rename "Toast" to "Notification". I dont think it is clear at all that a notification is named toast because it pops up from the bottom like a toast. And if you change its position to pop up from the top the analogy is totally gone. Further a toast is a very cultural specific food. Some western families dont even have a toaster and I dont think toasts are a common thing in non-western countries. (Offtopic: Toast is unhealthy, dont eat toasts guys. Get real bread instead that is not all-white :D)

@GalacticHypernova
Copy link

GalacticHypernova commented Nov 29, 2024

@MickL while on v2 docs, last I checked, v3 is not linked, on v3 docs v2 is indeed linked. I am also unsure of how this is a problem given that an official release is yet to happen and therefore, in my opinion, only people following this issue, who are willing to test it early, need to even know about its existence for now.

Regarding the toast, I would have to disagree. There is a very distinctive difference between a toast and a notification in the programming world (web development is only one of the areas). A toast, by programming definition, is a small, unobstructive pop-up, typically in the corner of a page, meant to notify of non-critical information, like success/error messages. A notification, on the other hand, is a more prominent overlay meant to convey important information, like the notifications you get on your phone from apps/websites. Therefore, the toast should stay as toast because its name is true to its purpose, and it has nothing to do with food. Nuxt UI indeed provides a way to use toasts as notifications with further customization and actions, but it is still a toast in essence. (And regarding your off topic statement, toast can also be made from whole grain bread, it doesn't have to be white)

And lastly, regarding types, I believe there are already a few PR's meant to address some aspects of it

@MickL
Copy link

MickL commented Nov 29, 2024

@MickL while on v2 docs, last I checked, v3 is not linked, on v3 docs v2 is indeed linked. I am also unsure of how this is a problem given that an official release is yet to happen and therefore, in my opinion, only people following this issue, who are willing to test it early, need to even know about its existence for now.

Personally I would recommend everyone who starts a new project "now" to use v3. Tailwind is in beta and Nuxt UI also looks kinda ready soon. Also v3 is implementing breaking changes everywhere. Personally I would even write a big heads up on the mainpage of Nuxt UI that v3 is coming up.

A notification, on the other hand, is a more prominent overlay meant to convey important information, like the notifications you get on your phone from apps/websites.

I dont see any difference between a "toast" as you say and a phone notification. On macOS the "toasts" are also called notifications and they have the same size as a Nuxt UI toast. They come in on the top right, not the direction of a physical toast (Offtopic: The "whole grains" are as unhealthy as normal ones)

@GalacticHypernova
Copy link

I dont see any difference between a "toast" as you say and a phone notification.

If you'd like, we could continue this topic privately to not clutter the issue, but essentially, as I said (though this time with slightly more details) a toast is a small non-intrusive unobstructive pop-up for general, non-critical feedback that goes away after a while automatically, not requiring any interaction from the user and not blocking anything, for example error/success messages. A notification doesn't go away automatically and requires interaction (like to dismiss or to read), is more obstructive and provides more critical details (like the example I provided with the notifications you get on your phone in the notification bar, which don't go away until you swipe them aside, or if you want an example from a website then the notification menu on YouTube which requires you to either click on it, hide it, or turn off all notifications from the source of the notification)

@MickL
Copy link

MickL commented Nov 29, 2024

On iOS and macOS the notifications are small, come in for a few seconds and go away automatically (on macOS optionally they can stay until user reacts) and they are called notification and not toast. What you describe is the notification center where notifications stay because normally they are visible only for a few seconds exactly like the "toast" component in Nuxt UI.

@madsh93
Copy link

madsh93 commented Dec 3, 2024

Hi Benjamin!

Just trying out Nuxt UI 3. I've noticed that with UInput the returntype of @update:model-value is always string | number even though type is set to text. In this case it can never return the type number as far as I know.

However an input with type number can, when the field is empty.

export interface InputEmits {
  (e: 'update:modelValue', payload: string | number): void
  (e: 'blur', event: FocusEvent): void
  (e: 'change', event: Event): void
}

@bpolaszek
Copy link

Hello Benjamin!

Newbie to @nuxt/ui (never used it before), I'm currently trying the new v3 beta.

3 questions:

  • Overriding theme seem to occur in some app.config.ts but it looks like nothing makes reference to it. You're supposed to use defineAppConfig which is a function I couldn't find anywhere (auto-imports are turned off on my projects). Is it some legacy stuff borrowed from v2 and not updated in the docs or just something not documented enough?
  • How could I override the theme of, let's say, buttons, by just appending cursor-pointer to the existing theme classes (e.g. without replacing the whole buttons theme with only that class)?
  • Would you consider enabling Discussions on this repository so that Q&As can be filed in a dedicated space?

Thank you!
Ben

Copy link
Member Author

No sorry, I don't like Discussions and rather keep everything is Issues. Also, I'm using a tool called Volta (volta.net) made by me at NuxtLabs to manage open-source and it doesn't support Discussions.

  1. defineAppConfig is from Nuxt: https://nuxt.com/docs/getting-started/configuration#app-configuration, you can import it from #imports if you disabled auto-imports.
  2. To override components, everything is documented here: https://ui3.nuxt.dev/getting-started/theme#customize-theme

@bpolaszek
Copy link

Alright, nothing worked as expected on my side (existing Nuxt4 + TailwindCSS 4-beta project) but recreating my project based on @nuxt/ui's starter did the trick. 🤷

Didn't even know about defineAppConfig though it looks pretty common! 😅

Sorry for bothering!
Ben

@MickL
Copy link

MickL commented Dec 4, 2024

@benjamincanac I was trying v3 for a bit and I just wanted to give you and everyone else who was involved my biggest respect and say that I am amazed by all the work that has been done! I was hoping for a bit of visual improvements, for example the examples Reka UI showcases look a bit cleaner to me. And I was not disappointed, I see tiny visual improvements everywhere, and an all new design for at least the Table which I really like. Further what I really like is that it seems way more customizable. Some things are not hardcoded anymore (e.g. button doesnt have cursor-pointer class) which seems a bit cumberstone at first but just makes everything more flexible. The same goes for the new slot system. A highly requested feature was that components can be customized globally, and this can be done now for each component and their slots. Further I really like the improved docs! At the start of every component we have the basic usage, no more need to search for features! Then there is an examples section that shows most common specific use cases. And on top of everything you added new components like calendar, stepper and for example the carousel seems to be working SO much better.

Keep up the good work, cant wait for first beta!

Btw I recommend everyone to use latest commit until next alpha comes out, because alpha 9 currently doesnt use Reka UI. @benjamincanac is pushing new commits kinda every minute, to install current latest commit: bun add https://pkg.pr.new/@nuxt/ui@e791031

@divine
Copy link

divine commented Dec 7, 2024

Hello,

Looks like the new Dropdown lost mode functionality https://ui.nuxt.com/components/dropdown#mode.

@benjamincanac will this be added back or removed completely?

I've still few issues that are still bugging me (I'll report later today) but looks nearly perfect.

Thank you for the great work :)

Copy link
Member Author

@divine #2138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests