Question
How do I create a
<paper-button>
group UI element with the following characteristics?
- It is a group of
<paper-button>
elements. - It is stacked vertically.
- Each button fills the entire width of the container (without margin, padding or horizontal white space).
- There is no margin, padding or vertical white space between the buttons.
Examples:
- The effect I am seeking is analogous to
<body fullbleed>
only scoped to the button's parent container. - Similar to the Bootstrap "Vertical variation" shown here.
- If you have Google Drive, hover your mouse over the menu items in the left margin of the page. (Under the red button labeled "New.")
- Do a Google search. The dropdown menu that appears from the search field predictively suggesting possible questions you want is also another example of the look/feel I am after.
Attempts:
See below code for my previous attempts to:
- stack vertical buttons using
<p>
tags and - use a
<paper-menu>
.
Research:
Demo: JS Bin
Code:
<!doctype html>
<html>
<head>
<title>polymer</title>
<script src="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents-lite.js"></script>
<link rel="import" href="https://rawgit.com/Polymer/polymer/master/polymer.html">
<link rel="import" href="https://rawgit.com/PolymerElements/paper-button/master/paper-button.html">
</head>
<body>
<dom-module id="x-test" noscript>
<template>
<!-- Attempt #1: Stacking Buttons -->
<div id="container">
<p><paper-button>One</paper-button></p>
<p><paper-button>Two</paper-button></p>
<p><paper-button>Three</paper-button></p>
</div>
<!-- Attempt #2: <paper-menu> -->
<paper-menu>
<paper-item>One</paper-item>
<paper-item>Two</paper-item>
<paper-item>Three</paper-item>
</paper-menu>
</template>
</dom-module>
<x-test></x-test>
</body>
</html>