This repository has been archived by the owner. It is now read-only.
Small, useful, snippets/samples that show how to do things the Polymer.dart way.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Polymer Snippets

Small, useful, snippets/samples that show how to do things the Polymer way.

Port of polymer.js snippets in

Repo structure

All snippets go in web/.

Each snippet should have its own directory. Here is a typical list of files for a snippet:

  • my_element.html: the HTML for <my_element>
  • my_element.dart: the Dart code for <my_element>
  • index.html: the entry point for the snippet. Imports <my-element>.
  • the documentation for the snippet. This should mirror the documentation in the original as much as possible.

Unless there is a compelling reason to do so, name your element <my_element>.

Be sure to add the snippet to the entry_points list in pubspec.yaml.

Keeping track of upstream commits

When porting a polymer.js snippet, be sure to reference the original, and include the commit ID. For example:


See for details on how to get a link to the commit ID.

Making your snippets Dart-y

All snippets should follow the Dart Style Guide.

Before creating a pull request, please run the sample in Dart Editor, ensuring that it runs in both JS and Dartium without errors or warnings.



Control flow

Insertion points

Observing changes



Styling elements

Layout attributes

Polymer elements

Samples using Polymer elements.

Paper toolbar