i need a second paper drawer on the right side of my site. Is this possible with polymer 1 and the paper-drawer element? have anyone a code sample for me?
thanks for your help!
i need a second paper drawer on the right side of my site. Is this possible with polymer 1 and the paper-drawer element? have anyone a code sample for me?
thanks for your help!
If you want to keep using elements by Google, you can use app-layout's app-drawer-layout
, they even have a 2 drawer demo so you can view its source code for an example
Polymer's paper-drawer-panel
does not support more than one drawer, but you could use a third-party element for that: paper-multidrawer-panel
.
<paper-multidrawer-panel>
<paper-header-panel left-drawer>...</paper-header-panel>
<paper-header-panel right-drawer>...</paper-header-panel>
<paper-header-panel main>...</paper-header-panel>
</paper-multidrawer-panel>
For future reference, I recommend searching https://customelements.io for any elements you might need. The search results include Polymer's own elements as well as those contributed by the community.
Just nest the drawers?
<paper-drawer-panel force-narrow drawer-toggle-attribute="d1" class="fit">
<div drawer>
<!-- Left drawer here -->
</div>
<div main class="fit">
<paper-drawer-panel force-narrow right-drawer drawer-toggle-attribute="d2" class="fit">
<div drawer>
<!-- Right drawer here -->
</div>
<div main class="fit">
<!-- Main contents go here -->
<h1>Left-drawer toggle</h1>
<paper-icon-button d1 icon="menu"></paper-icon-button>
<h1>Right-drawer toggle</h1>
<paper-icon-button d2 icon="menu"></paper-icon-button>
</div>
</paper-drawer-panel>
</div>
</paper-drawer-panel>
Working jsbin: http://jsbin.com/qocuyurazi/edit?html,output