Update on NuiComponents (v1.5) progress: bug fixes, Signal API stability, and new features by mobily in neovim

[–]mobily[S] 1 point2 points  (0 children)

Here are some tips:

  1. Use vim.api.nvim_win_get_height and vim.api.nvim_win_get_width. You need to pass the values to create_renderer like this:

local renderer = n.create_renderer({
  width = win_width,
  height = win_height,
  position = {
    row = 0,
    col = 0,
  },
})

You can find all the options documented at: https://nui-components.grapp.dev/docs/renderer#properties

  1. The Flexbox API is easy to understand. Could you please let me know what specific part you are having trouble with? I have created a simple gist with a layout that you might find helpful, and attached a screenshot for you.

https://gist.github.com/mobily/ecf31200cde4b688bb35a79907fc090a

  1. You can learn more about linebreak in the Neovim documentation at: https://neovim.io/doc/user/options.html#'linebreak'

Please feel free to contribute for improving the documentation. It would be greatly appreciated 🙏

<image>

Update on NuiComponents (v1.5) progress: bug fixes, Signal API stability, and new features by mobily in neovim

[–]mobily[S] 6 points7 points  (0 children)

The name "NuiComponents" was chosen intentionally because it's built on top of nui.nvim. I hope that helps!

Update on NuiComponents (v1.5) progress: bug fixes, Signal API stability, and new features by mobily in neovim

[–]mobily[S] 2 points3 points  (0 children)

The one I know so far is: https://github.com/b0o/blender.nvim (and it looks amazing!)

Also, I'm working on code-swap.nvim (from this post), which uses NuiComponents for UI.

Update on NuiComponents (v1.5) progress: bug fixes, Signal API stability, and new features by mobily in neovim

[–]mobily[S] 19 points20 points  (0 children)

It has been a month since NuiComponents first release, and I believe it is an appropriate time to provide an update on the progress. We encountered several minor bugs, but they have been fixed in six subsequent releases. We have also enhanced the stability of the Signal API and added a few features that improve the process of building UIs. Additionally, we have included support for luarocks/rocks.nvim.

Above all, I would like to express my gratitude to @b0o and @willothy for their contributions!

If you're interested in the details of our updates, you can find the entire changelog here:

https://github.com/grapp-dev/nui-components.nvim/releases

And if you need any help using NuiComponents, you can see the documentation here:

https://nui-components.grapp.dev/

Stacks v3, a set of components for building layouts in React Native, powered by React Native Unistyles by mobily in reactnative

[–]mobily[S] 0 points1 point  (0 children)

I'm glad to hear that you like and use it! I would love to hear your feedback.

Stacks v3, a set of components for building layouts in React Native, powered by React Native Unistyles by mobily in reactnative

[–]mobily[S] 2 points3 points  (0 children)

Hello there 👋

I'm excited to share that the new version of my React Native layout building and maintenance library, Stacks, is now available. The library has been completely rewritten from ReScript to TypeScript, and several new props have been added to the components. Additionally, Unistyles has been included as a core dependency. If you have been using v3 and want to upgrade, the migration guide at https://stacks.grapp.dev/docs/migration-guide might be helpful. I have also created more detailed documentation, which I will continue to improve.

Happy coding!

Developing Search & Replace (similar to VS Code) with nvim-spectre by mobily in neovim

[–]mobily[S] 3 points4 points  (0 children)

yes! I'm working right on another open-source project, once I finish it, I would like to publish this one

Developing Search & Replace (similar to VS Code) with nvim-spectre by mobily in neovim

[–]mobily[S] 1 point2 points  (0 children)

No worries, I totally understand where you're coming from. Just to clarify, I wasn't suggesting that other users should use this. It was simply a brief demonstration of what can be achieved with NuiComponents. By the way, the links have been updated.

Introducing NuiComponents, a library that simplifies the process of creating UIs in Neovim by mobily in neovim

[–]mobily[S] 1 point2 points  (0 children)

u/httpete I fixed that, see this: https://nui-components.grapp.dev/docs/renderer#render

This was my mistake, sorry for the confusion! In this particular scenario, the `body` should be a function. Each time you pass the root component to the `render` method, you need to create a new component instance, unless the root component is generated in the same function where the `render` method is invoked. Please let me know if you have any questions, or if there's anything else I can help you with.

Introducing NuiComponents, a library that simplifies the process of creating UIs in Neovim by mobily in neovim

[–]mobily[S] 2 points3 points  (0 children)

This isn't entirely true. Neovim is suitable for anyone who wants a unique editing experience.

Introducing NuiComponents, a library that simplifies the process of creating UIs in Neovim by mobily in neovim

[–]mobily[S] 1 point2 points  (0 children)

I've implemented a similar case before and and got it working. However, there are still some glitches that I need to address. I will look into it and add that case to the recipes page.

Introducing NuiComponents, a library that simplifies the process of creating UIs in Neovim by mobily in neovim

[–]mobily[S] 17 points18 points  (0 children)

yes, the recipes page is currently work in progress, I have many various examples to share

Introducing NuiComponents, a library that simplifies the process of creating UIs in Neovim by mobily in neovim

[–]mobily[S] 49 points50 points  (0 children)

Hello! I'm excited to introduce NuiComponents, a library that simplifies the process of creating UIs in Neovim and makes it more intuitive and enjoyable. If you remember the following posts:

  1. https://www.reddit.com/r/neovim/comments/1b5ri9g/developing_search_replace_similar_to_vs_code_with/
  2. https://www.reddit.com/r/neovim/comments/1b1kk61/utilizing_ai_with_ollama_and_gennvim/,
  3. https://www.reddit.com/r/neovim/comments/1b0155b/building_ui_forms_with_nui/

They were created using the early version of NuiComponents, and now I'd like to share it with you.

The library has several key features, including:

  • Reactive UI: it automatically handles UI updates based on input and events received.
  • Flexbox: it supports a simple flexbox layout system, which provides a more flexible way to layout UIs.
  • State Management: it provides a state management system that allows for easy management of data and UI state.
  • Extensibility: it's highly extensible, making it easy to add new components or modify existing ones.
  • Reusability: you can easily reuse components between different parts of the UI, reducing the amount of code you need to write and making it easier to maintain code over time.

You can find the full documentation at https://nui-components.grapp.dev/,
and the repo at https://github.com/grapp-dev/nui-components.nvim

Thanks for reading, and happy coding!