Reference sections
Reference āŗ Client-side libraries
Kitten comes with several client-side libraries which are automatically served at runtime that you can use in your sites/apps.
The page tag provides a high-level interface for including most of them on your pages.
For example, to include htmx, you can add the following page tag to any HTML fragment that ends up on your page:
<page htmx>
You can also include any of them in your sites/apps manually, just like any other client-side script, by knowing their paths:
In /š±/library/:
| Library name | File name | Page tag attribute name | Version | Notes |
|---|---|---|---|---|
| Kitten cryptography module | crypto-1.js | n/a (ES module) | ^1 | |
| Kitten key store module | key-store-1.js | n/a (ES module) | ^1 | A signed-in personās identity as non-extractable Web Crypto keys in IndexedDB. |
| htmx | htmx-2.js | htmx | ^2 | Own fork. |
| htmx WebSocket | htmx-ws-2.js | ws | ^2 | |
| htmx idiomorph extension | htmx-idiomorph-0.8.js | idiomorph | ^0.8.0 | idiomorph from npm with Kittenās own copy of the extension. |
| Alpine.js | kitten-alpine-1.js | alpine | ^3 | Alpine.js, started by Kitten after every module on the page. alpinejs-3.js is still served for sites that include it by path. |
| kittenRuntime | kitten-1.js | n/a (always included) | ^1 | Configures htmx and defines kitten.ready. |
| Development-time hot reload | kitten-hot-reload-1.js | n/a (development only) | ^1 | |
| Prism (CSS) | prism-1.css | n/a | ^1 | Used internally to syntax highlight Kitten error messages. Also see built-in Highlight.js syntax highlighter. |
| Water (CSS) | water-2.css | water | ^2 |
You can access the file names of htmx, its WebSocket and idiomorph extensions, Alpine.js, Water, and kitten-1.js on the kitten.libraries object, as the htmx, htmxWebSocket, htmxIdiomorph, alpineJs, water, and kittenRuntime properties. In production, the htmx, htmxIdiomorph, alpineJs, and water properties contain the minified file names. The htmxWebSocket and kittenRuntime properties are the same in production.
In production, htmx and Alpine.js are also gzipped (.min.js.gz).
The -N notation specifies the major version of the library. Since Kitten sites automatically update, if there is a major version update to a library, it will be added alongside previous versions so as not to break existing sites. So if htmx 2.x.x comes out, for example, with breaking changes and Kitten starts supporting it, it will be added as htmx-2.js. All minor and patch updates will be automatically updated without changing the name of the include.