Fetch Hyperform in any way you like as laid out on the downloads page.
dist/hyperform.min.js in your file:
<script src="hyperform/dist/hyperform.min.js"></script> <link rel="stylesheet" href="hyperform/css/hyperform.css"> <script>hyperform(window);</script>
// "classic" CJS variant: var hyperform = require('hyperform'); // or "newer" ESM variant: import hyperform from 'hyperform'; hyperform(window);
For Hyperform to work in old IEs you need polyfills for
WeakMap (IE 10 and lower), and
element.classList (IE 9 and lower).
Polyfill.io offers this as conveniant URL, that only returns the necessary polyfills based on the browser UA string:
Finished! Yes, in modern browsers Hyperform has zero external dependencies.
Hyperform is developed using a strict ES2015 module approach. If you want to
make use of the granular modules yourself, you can import them directly from
import hyperform from 'path/to/hyperform/src/hyperform';
There might be situations, where you just want to throw in the Hyperform
script element, let it do its magic and call it a day. To spare the call to
hyperform(window) you can simply add a special attribute to the embedding
<script src="path/to/hyperform.min.js" data-hf-autoload></script>
This will then automatically run
hyperform(window) for you. (Note: If you’re
supporting IE, then you must add a polyfill for
for this feature to work. If you don’t want that, simply call
hyperform(window) yourself somewhere in your code.)
Next: Usage – all the things you can do with Hyperform