Skip to content

Create design for switch/toggle Vaadin alternative #2555

Closed

Description

@MartinaeyNL

Description

The new Vaadin components library does not have a boolean toggle that we can re-use.
We need an alternative to <or-mwc-input type="switch">, where the meta item asOnOff: true is configured.
However, since it needs to align with our new Vaadin design system, we could use a design for this.

When creating this design, we should take several things into count:

  • Do we need a toggle / switch in the first place? If Vaadin does not have it, should we?

  • If we decide on a "custom toggle/switch", we should think about the development time it takes.
    We could potentially use a modified version of the checkbox component, or reuse tools available on the internet (like we did with Vaadin) that could potentially help out.

Switch / toggle in Manager UI (v1.18.0)

The current switch is built using Material UI, see their documentation.
It's an alternative to showing a checkbox, where this toggle often represents turning something on and off.

Image

Activity

  1. added theissue type on Feb 24, 2026
  2. added
    SpikeInvestigation to gain knowledge or reduce uncertainty
    on Feb 24, 2026
  3. changed the title [-]Create design for toggle Vaadin alternative[/-] [+]Create design for switch/toggle Vaadin alternative[/+] on Feb 24, 2026
  4. remyberden commented on Feb 27, 2026

    @remyberden

    Functionally a checkbox and toggle are the same. But in UX, a general rule is that a checkbox is used when the user is required to actively save settings. So for instance, in the modify asset page it can be part of the settings in the attribute list. the action will take effect after saving the changes.

    A toggle means immediate action/save. So the toggle component would make sense in the view asset page when toggling between modes. I haven't really found a good reason why Vaadin does not include a toggle button, but I think in our case, we definitely need one.

    I did find this add-on: https://vaadin.com/directory/component/togglebutton-for-flow Is this something we can use?

  5. MartinaeyNL commented on Feb 27, 2026

    @MartinaeyNL
    MemberAuthor

    I did find this add-on: https://vaadin.com/directory/component/togglebutton-for-flow Is this something we can use?

    No unfortunately not.
    It is exclusive to the Java implementation of Vaadin (called Flow), and not the web-only implementation that we're using.
    Along with that, the code of that addon hasn't been updated for years, nor is the code interesting for us to copy/paste.

    I think it makes sense to either restyle the Vaadin checkbox or the HTML default checkbox to a "Toggle switch".
    I'll need to do research on what the best solution is, and whether the accessibility will be an issue.

  6. remyberden commented on Mar 5, 2026

    @remyberden

    I've added the toggle component to OR Design System on Figma.

    Image
  7. self-assigned this
    on Mar 10, 2026
  8. MartinaeyNL commented on Mar 10, 2026

    @MartinaeyNL
    MemberAuthor

    I'll take a look at what the estimated development time would be to create a "custom toggle switch".
    From there, I'll create a separate issue so I can pick it up in an upcoming sprint.

  9. MartinaeyNL commented on Mar 12, 2026

    @MartinaeyNL
    MemberAuthor

    (removed this comment, as it was meant for a different issue)

  10. MartinaeyNL commented on Mar 20, 2026

    @MartinaeyNL
    MemberAuthor

    The design seems OK and simple enough to integrate solely by using CSS.
    There are plenty of examples online, and I don't expect too much technical headaches maintaining it.

    Created #2637 for the implementation phase 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

SpikeInvestigation to gain knowledge or reduce uncertainty

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions