UI base components lib? #71
Replies: 2 comments 1 reply
-
I do agree it could be a lot of work to create our own UI components, and it's not really valueable. It's true that bootstrap components where great and easy to use. We don't use bootstrap in geonetwork-ui to bring some fresh air in the UI, but also because it does not handle CSS variables, but it seems they are including them somehow (we might need to take a closer look) https://getbootstrap.com/docs/5.0/customize/css-variables/ I am not favor about angular-materials cause it clearly imposes the look of your component, the google-material way, everything has to be material or not, otherwise the UI will look weird. I agree that have great 'ready to work' components though. This is a complex topic, seems @jahow and @MichelGabriel already took some time to consider pro and cons, now after some months of dev, maybe the vision has changed. I can't really decide about that, i didn't use TW at all, it look promising and except about the ui components, it brings satisfaction and is largely customisable. Maybe turn back to BS5 could be considered as well. I let other give their opinion. |
Beta Was this translation helpful? Give feedback.
-
Hi, the dropdown component is actually the one thing that made me regret bootstrap the most. Recreating a dropdown from scratch is a lot of work as it needs logic for showing a popup, handling keyboard navigation, accessibility concerns, etc. Regardless, during my experiments I had a dropdown about 75% finished, I still have the branch somewhere. Popper.js does a lot of the heavy work anyway. Bootstrap 4 does not support web components so I guess it's out of the question. Not sure Bootstrap 5 or angular-material will work well in web components, using one of these frameworks (or any other for that matter) is taking that risk. In my opinion using a CSS/components framework isn't that huge of a win and brings many other issues as well: Pros:
Cons:
Some example of things that ended up being custom components in GN legacy ui:
And there is a lot of code to wrap the bootstrap components and offer functionalities specific to Geonetwork, so it was not exactly "include and forget". In my opinion going with a framework is taking a risk, making development faster in the short term but potentially causing issues and constraints in the long run. As for CSS variables, there is a concrete example: the web components that were funded by the EEA. Although they don't show much of a theme, their colors can still be changed dynamically. Not using CSS variables means going back to the current system in GN4 where colors are defined in the admin, saved in the database and the datadir, and require a new portal for each set of color. My 2 cents :) |
Beta Was this translation helpful? Give feedback.
-
Currently we are defining all UI basic components (eg. progress bar, drop down, button, step bar) from scratch in
https://github.com/geonetwork/geonetwork-ui/tree/master/libs/ui/src/lib.
For example, if we want to have a simple selector to choose the layout of results. The list of layout is also using an icon and when selecting a layout, the icon become the selector label. Nothing fancy.
But if I want to do this with current
ui/dropdown-selector
, we have to:... then we may need grouping, disable, multiple, error messages, keyboard interactions ...
All this could be done directly with libs like angular-material. Quick experiment:
https://apps.titellus.net/catalog/gn-ui/search/
https://apps.titellus.net/catalog/gn-ui-material/search/
Why not using some existing libs for this? Pros&cons? From past discussions on this topic I remember; main complains:
But on the other hand
Is this something to discuss ? @fgravin , @MichelGabriel , @pvgenuchten
Personaly, I'm not sure we:
Beta Was this translation helpful? Give feedback.
All reactions