Luke Taylor Luke Taylor - 1 year ago 193
AngularJS Question

Vertical md-toolbar

Is a vertical toolbar a material-compliant element? Is it available in Angular Material?

I'm looking for a way to line up several buttons with icons in a sidebar. I want something the size of a

, but that behaves like a
. The
seems to have a fixed width, and is far too wide for the icons I want to pin there.

Is there an easy solution for this? I've tried using something along the lines of

<section layout="row">
<!-- Sidebar (this should be thin) -->
<md-sidenav class="md-sidenav-left" md-is-locked-open="true" md-whiteframe="4">
<md-button><i class="material-icons">home</i></md-button>

<!-- Main app area -->
<div id="content-main"></div>


However, the sidebar appears much too thick for the simple icon I'm displaying in it.

Is there a way to get a vertical
or a thinner
, or should I rethink my design?

Answer Source

A vertical toolbar is relatively easy to do with Angular Material - CodePen

  • Use layout="column" to align the icons
  • Use <span flex></span> to separate the top icons from the bottom icons
  • Control the width with CSS
  • Maybe use md-whiteframe to add a raised effect


<div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp" layout-fill layout="column">
  <md-content flex layout="column">
    <md-whiteframe id="vericalToolBar" class="md-whiteframe-8dp" layout="column" layout-align="start center" flex>
      <md-button class="md-icon-button" aria-label="More">
        <md-icon md-svg-icon="img/icons/more_vert.svg"></md-icon>
      <md-button class="md-icon-button" aria-label="Favorite">
        <md-icon md-svg-icon="img/icons/favorite.svg"></md-icon>
      <p id="toolBarTitle" class="md-title">My vertical toolbar</p>
      <span flex></span>
      <md-button class="md-icon-button" aria-label="Favorite">
        <md-icon md-svg-icon="img/icons/cake.svg"></md-icon>


#vericalToolBar {
  background-color: rgb(1,74,182);
  width: 50px;

#vericalToolBar md-icon {
  color: rgba(255,255,255,0.87);

#toolBarTitle {
  writing-mode: tb-rl;
  color: rgba(255,255,255,0.87);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download