Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer paper-button not rendering

I downloaded the Polymer starter kit (Polymer 1.0) and have been trying to add a simple paper button to my webpage, but it is not rendering correctly. Here is the relevant code:

<section data-route="home">
      <paper-material elevation="1">

        <paper-button raisedButton
          id='rendered'
          label='patient'
          on-click='{{clickHandler}}'></paper-button>

        <button>Try Me</button>

        <paper-icon-button icon="refresh" label="label"></paper-icon-button>
        <paper-button raisedButton>search!</paper-button>

      </paper-material>

    </section>

The first button doesn't show up at all, the second normal button does, the third button works, but the label doesn't show up, and the final button renders as text and isn't clickable

Result

like image 445
nickjm Avatar asked May 11 '26 23:05

nickjm


2 Answers

Had the same problem, doesn't seem to load the paper-button element by default.

Fixed it by adding to the /app/index.html page before the paper-button was called.

<link rel="import" href="/bower_components/paper-button/paper-button.html">

Or add it to /app/elements/elements.html

like image 78
jcoshea Avatar answered May 14 '26 16:05

jcoshea


paper-button doesn't have a label attribute or raisedButton attribute. If you want the button to have a label, you have to write it like a typical button tag. If you want it to have a shadow, you'll have to add a raised attribute instead. The paper-icon-button also doesn't have a label attribute. If you want to display something like that, you can try this instead:

<paper-button raised>
  <iron-icon icon="add"></iron-icon>
  <span>Add Something new</span>
</paper-button>
like image 40
Neil John Ramal Avatar answered May 14 '26 16:05

Neil John Ramal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!