Overview: Web Libraries

Send feedback

What kind of support is available for web programming in Dart? Where can you learn more?


Work through the Angular 2 code lab, and then learn more from the Angular 2 for Dart docs.

JS interop

Perhaps you want to leverage one of the many existing libraries written in JavaScript. Use package.js to implement Dart-JavaScript interoperability. The chartjs example provides an end-to-end example of using package:js.

Low-level HTML

The GUI for a web app is programmed in HTML and is represented in the browser by a tree structure called the Document Object Model (DOM). Understanding how the DOM works is important for developing a deeper understanding of HTML concepts. Use the dart:html library to modify the DOM programmatically.

Once you’re ready to develop complex applications that support event handling and dependency injection, for example, you’ll want a more powerful solution, such as Angular 2 for Dart.

For an introduction to low-level DOM programming, check out the original Pirate code lab. The low-level HTML tutorials have further information on how to include a Dart script in an HTML page, and how to add and remove elements from a web page. The Improving the DOM article gives an overview of Dart’s DOM API, and how it differs from the JavaScript DOM API.

Other libraries

You’re free to use whatever open-source libraries you like when creating web apps. For example, you can use Polymer elements.

Also see the FAQ.