web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Add a traffic light style theme to the checkbox component

Open MatthewVaadin opened this issue 1 year ago • 1 comments

Describe your motivation

In some contexts, it is useful to have a checkbox component that uses red/green rather than the default grey/blue. For example:

  • To make a particular setting stand out or convey importance, such as enabling/disabling an entire section/module/service
  • To align with other UI elements that use red for error/off and green for ok/on

Describe the solution you'd like

I would like a theme that can be set on the checkbox component so that it uses red for unchecked, green for checked and amber/yellow for indeterminate. The unchecked state would no longer look "empty" so may require a symbol to be used (e.g. a cross).

Describe alternatives you've considered

Up to now, I have been using my own custom style sheet, but was encouraged to submit this for others to use.

Additional context

No response

MatthewVaadin avatar Sep 01 '24 06:09 MatthewVaadin

See https://github.com/vaadin/web-components/pull/7737#issuecomment-2330599627

web-padawan avatar Sep 05 '24 07:09 web-padawan