JQuery Mobile JQuery Mobile - 5 months ago 38
CSS Question

Polymer - Paper Toggle Button Layout

I'm learning Polymer. Currently, I have a

paper-toggle-button
element in my app defined like this:

<paper-toggle-button checked="{{ isEnabled }}">enable?</paper-toggle-button>


When this is rendered, it renders is like this:

[switch] enable?


My question is, is there a way to put the label to the left of the switch? In other words, I want to show the control like this:

enable? [switch]


How can someone do that?

Answer

Err can't you just put your label text before the toggle button?

<span>enable?</span><paper-toggle-button checked="{{isEnabled}}"></paper-toggle-button>