Cms: Re-consider the UI for custom on/off states for lightswitches

Created on 18 Aug 2020  ·  7Comments  ·  Source: craftcms/cms

Description

This is visually ugly and confusing. It just doesn't work having two labels with an associated input in the middle.

Can I suggest that we keep the lightswitch to the left of the label, and we simply change the label text to match the currently selected value for the on/off state?

Screen Shot 2020-08-18 at 15 57 51

enhancement

Most helpful comment

Craft 3.5.8 is out now with that change.

All 7 comments

That said, suggested solution may _also_ be confusing. Hmmm.

Ugly maybe – especially if placed beside another field as you’ve got it in the screenshot – but not sure I agree with it being confusing. Seems pretty straightforward to me. Only showing one label would lead to confusion though.

Ugly a bad choice of word; "unexpected". Here, the position of the circle is supposed to indicate which label is active... but then we also have the green as a state indicator; which is confusing. What does that mean? This isn't an on:off switch.

I have never seen this style of UI component on a web form before - I also don't have a simple solution other than orientating the toggle vertically and having the on:off labels top and bottom, by the side of a vertical toggle - and ditching the green colour when these labels are used.

I agree; my initial inclination was to only add the right-side label (see https://github.com/craftcms/cms/issues/3741#issuecomment-673169690). It’s been done before though (e.g. https://mdbootstrap.com/docs/jquery/forms/switch/).

Just slightly restyled Lightswitch fields when they have ON/OFF labels. Looks less ugly now :)

The “System Status” setting with “Offline” and “Offline” labels

Looks tidier, nice one thanks.

Craft 3.5.8 is out now with that change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bitboxfw picture bitboxfw  ·  3Comments

michaelhue picture michaelhue  ·  3Comments

rynpsc picture rynpsc  ·  3Comments

lukebailey picture lukebailey  ·  3Comments

brandonkelly picture brandonkelly  ·  3Comments