Git Product home page Git Product logo

app-layout's Introduction

App Layout

http://polymerlabs.github.io/app-layout/

It's a set of experimental layout elements for your app. It includes:

Install

$ bower install PolymerLabs/app-layout --save

app-toolbar

app-toolbar is a horizontal bar containing items that can be used for label, navigation, search and actions.

Example

Add a title to the toolbar

<app-toolbar>
  <div title>App name</div>
</app-toolbar>

Add a button in the left and right side of the toolbar

<app-toolbar>
  <paper-icon-button icon="menu"></paper-icon-button>
  <div title class="flex">App name</div>
  <paper-icon-button icon="search"></paper-icon-button>
</app-toolbar>

You can use the attributes top-item or bottom-item to completely fit an element to the top or bottom of the toolbar respectively.

Styling app-toolbar

The following custom properties available for styling:

Custom property Description Default
--app-toolbar-font-size Toolbar font size 20px

app-header

app-header is a container for app-toolbar. It can add effects to the toolbars based on the scroll position.

Example

Condense the header when the user scrolls

<app-header condenses>
  <app-toolbar>
    <div title>App name</div>
  </app-toolbar>
</app-drawer>

app-header-layout

app-header-layout is a layout element that contains a header and a content. This layout element uses the document scroll by default, but this element can also define its own scrolling region.

Example

Using the document scroll

<app-header-layout>
  <app-header condenses waterfall>
    <app-toolbar>
      <div title>App name</div>
    </app-toolbar>
  </app-header>
  <div>
    <!-- content goes here -->
  </div>
</app-header-layout>

Using an own scrolling region

<app-header-layout has-scrolling-region class="fit">
  <app-header condenses waterfall>
    <app-toolbar>
      <div title>App name</div>
    </app-toolbar>
  </app-header>
  <div>
    <!-- content goes here -->
  </div>
</app-header-layout>

app-drawer

app-drawer is a navigation drawers that can slide in from the left, right, bottom or top.

Example

Add a drawer in the left side of the screen

<app-drawer position="left" opened></app-drawer>

Add a drawer in the right side of the screen

<app-drawer position="right" opened></app-drawer>

Styling

app-drawer has the following custom properties for styling:

Custom property Description Default
--app-drawer-background-color Background color white
--app-drawer-duration The duration of the transition 0.2s
--app-drawer-timing-function The timing function of the transition linear

app-drawer-layout

app-drawer-layout is a layout element that contains a drawer and a main content. When the viewport width is smaller than responsiveWidth, this element changes to narrow layout. In narrow layout, the drawer will be stacked on top of the main content. The drawer will slide in/out to hide/reveal the main content.

Example

By default the drawer is in the left side of the screen

<app-drawer-layout>
    <div drawer>
        <!-- drawer content -->
    </div>
    <div main>
        <!-- main content -->
    </div>
</app-drawer-layout>

app-scrim

app-scrim is a transparent layer behind overlays that helps to create focus on the content.

Example

<app-scrim visible></app-toolbar>

Styling

app-scrim has the following custom properties for styling:

Custom property Description Default
--app-scrim-color Scrim color black
--app-scrim-opacity Scrim opacity 0.5

app-layout's People

Contributors

blasten avatar frankiefu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.