Skip to main content

JavaScript interoperability

Seamlessly integrate JavaScript libraries and APIs into your Dart web app.

Overview

#

The Dart web platform provides powerful tools to call JavaScript from Dart and vice-versa and allows you to leverage the vast JavaScript ecosystem without leaving your Dart code.

This page provides a central hub for learning about JavaScript interoperability in Dart. You'll find resources to get you started, detailed usage guides, and information on the latest dart:js_interop library. Whether you're looking to use a specific JavaScript library, or interact with browser APIs, this is the place to start.

Get started wtih JS interop:

Review the reference guides:

Interact with the browser:

The evolution of JavaScript interop

#

Dart 3.3 introduces a new generation of JS interop which offerins a unified set of features and APIs to access JavaScript and browser functionalities within your Dart code. This modern approach enhances the developer experience and enables WebAssembly (Wasm) support, aligning Dart with the future of the web.

The following table maps Dart's new JS and web interop solutions to their past counterparts:

Work with deprecated features

#

If you maintain legacy code, you can continue to work with some deprecated features. To learn more about JS interop deprecated features, see the Past JS interop guide.

Additional resources

#

Previous JavaScript interop libraries:

Additional documentation on JavaScript interop: