designsystemet icon indicating copy to clipboard operation
designsystemet copied to clipboard

Investigate Designsystemet web components

Open mimarz opened this issue 10 months ago • 6 comments

Investigate and set the premise of what the Designsystemet web components are going to be (and not).

Make a blog post about our findings and approach

Notes

  • State of web components
  • Explain why we won't make web components for all components
  • Code convention for making web-components
  • Testing, linting, formating etc.
  • Which components do we see as web-component candidates

mimarz avatar Mar 04 '25 13:03 mimarz

A comment from the side here: As you say, not all elements need be web components, as some don't need the abstraction and encapsulation (of logic and structure) that web components provide. The simple ones can be just HTML + CSS. As a library user, it doesn't really make much difference, since web components look like plain HTML and are supported natively by the browser. So why not just create one version of Designsystemet called browsernative or something similar, and make a note of which components are actually web components. The important point for the developer (library user) is that using this version doesn't imply having to use a specific framework.

hallvard avatar Mar 06 '25 08:03 hallvard

Explain why we won't make web components for all components

Why have react components for simple html + css?

poi33 avatar Mar 10 '25 14:03 poi33

Which components do we see as web-component candidates

My take on this is: Any component that have state / logic.

  • Details (because browser default are bad & u-element)
  • Dialog
  • Dropdown
  • MultiSuggestion
  • Pagination
  • Popover
  • Suggestion
  • Tabs
  • ToggleGroup
  • Tooltip ? ( Might be possible without )
  • Search ? ( Only clear feature requires logic )

poi33 avatar Mar 10 '25 14:03 poi33

Any update on this? @Barsnes Still waiting for the technical approach before trying to make web-component versions of the components.

poi33 avatar Aug 15 '25 11:08 poi33

Any update on this? @Barsnes Still waiting for the technical approach before trying to make web-component versions of the components.

Hi, we have not been able to investigate this as much as we would like yet. We are prioritizing our documentation and fixes on our current packages right now. I'm hoping we can take a deeper look at this a bit later this year, depending on available resources.

Since we have the CSS package, creating a third-party library is a bit easier then it used to be.

Barsnes avatar Aug 15 '25 12:08 Barsnes

#4127

Barsnes avatar Oct 08 '25 13:10 Barsnes