Installing Unpoly

No dependencies

Unpoly has no dependencies on the client or server.

You can write your server-side code in any programming language like Ruby, Node.js, PHP or Python. By loading the frontend files below, Unpoly's API becomes available to your HTML templates and JavaScripts. No server-side integration is required.

Unpoly also works great with static sites.

Frontend files

Unpoly consists one JavaScript file and one CSS file:

Development Production
unpoly.js unpoly.min.js 49.8 KB gzipped
unpoly.css unpoly.min.css 1.0 KB gzipped

unpoly.js is transpiled to ES2020 and will work in all modern browsers.
If Internet Explorer 11 or legacy Safari versions are a concern for you, see legacy browser support.

Initialization

Include Unpoly before your own stylesheets and JavaScripts:

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="unpoly.css" />
    <link rel="stylesheet" href="script.css" />
    <script src="unpoly.js"></script>
    <script src="scripts.js"></script>
  </head>
  <body>
    <!-- HTML here may use Unpoly attributes like [up-follow] -->
  </body>
</html>

You may also load Unpoly with <script defer> or <script type="module">.

By default, Unpoly automatically initializes on the DOMContentLoaded event and runs your compilers on the initial page. For manual initialization, load Unpoly with <script up-boot="manual"> and later call up.boot().

unpoly.js defines a single global property window.up to expose its API to your JavaScripts.

Installation methods

You have multiple options for downloading and integrating Unpoly:

Legacy browser support

Recent versions of Unpoly supports all modern browsers.

The last version with support for Internet Explorer 11 is 2.7.

unpoly.js also uses modern JavaScript syntax that may not supported by some legacy browsers or build pipelines. If you're not already working around this with a transpiler like Babel, you may also use the ES6 build of Unpoly:

Development Production
unpoly.es6.js unpoly.es6.min.js 51.9 KB gzipped

The ES6 build does not contain any polyfills.

Bootstrap integration

If you're using Bootstrap, there are some optional files that configures Unpoly to use Bootstrap's CSS classes:

Development Production
unpoly-bootstrap3.js unpoly-bootstrap3.min.js 0.5 KB gzipped
unpoly-bootstrap3.css unpoly-bootstrap3.min.css 0.1 KB gzipped
unpoly-bootstrap4.js unpoly-bootstrap4.min.js 0.5 KB gzipped
unpoly-bootstrap4.css unpoly-bootstrap4.min.css 0.1 KB gzipped
unpoly-bootstrap5.js unpoly-bootstrap5.min.js 0.5 KB gzipped
unpoly-bootstrap5.css unpoly-bootstrap5.min.css 0.1 KB gzipped

Upgrade shim

If you're upgrading from an older version you should also load unpoly-migrate.js to polyfill deprecated APIs:

Development Production
unpoly-migrate.js unpoly-migrate.min.js 8.2 KB gzipped