Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Allow on/off label placement on either side of ToggleSwitch #3696

Open
gabbybilka opened this issue Nov 25, 2020 · 4 comments
Open
Assignees
Labels
area-ToggleSwitch feature proposal New feature proposal team-Controls Issue for the Controls team

Comments

@gabbybilka
Copy link
Member

gabbybilka commented Nov 25, 2020

Proposal: Add alternate label placement to ToggleSwitch

Summary

Apps are interested in a left-positioned on/off label on the ToggleSwitch instead of it appearing on the right. We're thinking of adding additional API to support the choice between a left or right positioned on/off label. However, we would like to hear from the community on whether this would be taken advantage of in your apps or if the proposed approach can be improved upon.

Current ToggleSwitch on/off label position

image

Additional ToggleSwitch on/off label position

image

Rationale

  • If a popular pattern, a built in API to switch between the two modes would increase consistency of exact recommended position

Scope

Capability Priority
A on/off label can appear to the left of the switch itself (in LTR languages) without re-templating or re-styling the ToggleSwitch Must

Implementation exploration

An on/off content positioning boolean

<ToggleSwitch IsOnOffContentPositionOpposite="true" />
// In RTL languages, the OnOffContent is by default to the left of the ToggleSwitch. Setting this to true would mean the OnOffContent would appear to the right of the ToggleSwitch and the header label would still be right-aligned.

An on/off position property with new enum

<ToggleSwitch OnOffContentPosition="Left" />
enum ToggleSwitchOnOffContentPosition 
{
  Right, // default
  Left,
}

Open Questions

  • Are you changing the location of the on/off label in a ToggleSwitch currently?
  • Is there a use to add more positions than merely left or right?
@gabbybilka gabbybilka added the feature proposal New feature proposal label Nov 25, 2020
@gabbybilka gabbybilka self-assigned this Nov 25, 2020
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Nov 25, 2020
@gabbybilka gabbybilka added area-ToggleSwitch and removed needs-triage Issue needs to be triaged by the area owners labels Nov 25, 2020
@mdtauk
Copy link
Contributor

mdtauk commented Nov 25, 2020

Seems like a very sensible thing to add. It would be useful for aligning ToggleSwitches to the right without any awkward space after the different content strings.

@bpulliam bpulliam added the team-Controls Issue for the Controls team label Aug 8, 2023
@greatoceansoftware
Copy link

Would also like ability to position the Header to the left of the ToggleSwitch.

@FredoZeLegend
Copy link

i would also like to have the capability to set the content text as header too...

@Gaoyifei1011
Copy link

Proposal: Add alternate label placement to ToggleSwitch

Summary

Apps are interested in a left-positioned on/off label on the ToggleSwitch instead of it appearing on the right. We're thinking of adding additional API to support the choice between a left or right positioned on/off label. However, we would like to hear from the community on whether this would be taken advantage of in your apps or if the proposed approach can be improved upon.

Current ToggleSwitch on/off label position

image

Additional ToggleSwitch on/off label position

image

Rationale

  • If a popular pattern, a built in API to switch between the two modes would increase consistency of exact recommended position

Scope

Capability Priority
A on/off label can appear to the left of the switch itself (in LTR languages) without re-templating or re-styling the ToggleSwitch Must

Implementation exploration

An on/off content positioning boolean

// In RTL languages, the OnOffContent is by default to the left of the ToggleSwitch. Setting this to true would mean the OnOffContent would appear to the right of the ToggleSwitch and the header label would still be right-aligned. ### An on/off position property with new enum enum ToggleSwitchOnOffContentPosition { Right, // default Left, } ## Open Questions * Are you changing the location of the on/off label in a ToggleSwitch currently? * Is there a use to add more positions than merely left or right?

Isn't there any new progress in this improvement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ToggleSwitch feature proposal New feature proposal team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

6 participants