Installation
Choose an integration path and copy the exact snippet. All paths stay self-hosted and UI-kit compliant.
Install
Add to any Python project via git.
# Install
uv add git+https://git.gtw.lt/jax/jax-ui-kit.git
# With Jinja2 macros
uv add "jax-ui[jinja] @ git+https://git.gtw.lt/jax/jax-ui-kit.git"
# Pin to a release
uv add "jax-ui @ git+https://git.gtw.lt/jax/jax-ui-kit.git@v0.1.0"
CDN Bundle
Use prebuilt CSS/JS bundles from https://dev.gtw.lt/jax-ui-kit/.
# Latest (rolling)
<link rel="stylesheet" href="https://dev.gtw.lt/jax-ui-kit/jax/css/jax.min.css" />
<script src="https://dev.gtw.lt/jax-ui-kit/jax/js/jax.min.js" defer></script>
# Versioned (pinned: indev-f72023d)
<link rel="stylesheet" href="https://dev.gtw.lt/jax-ui-kit/jax/v/indev-f72023d/css/jax.min.css" />
<script src="https://dev.gtw.lt/jax-ui-kit/jax/v/indev-f72023d/js/jax.min.js" defer></script>
Colour Schemes
jax.css is the core plus the default scheme
(ember). To use another, import the colourless
core and one scheme instead — the only difference between two
builds of Jax is which scheme file is loaded.
Available: cobalt, ember, mono, moss, teal, viola.
Each carries both light and dark, so a scheme is orthogonal to
the theme toggle. Every one is gated by
jax-contrast-check at the same AA targets.
# Pick a scheme at import
<link rel="stylesheet" href="/jax/css/jax.core.css" />
<link rel="stylesheet" href="/jax/css/schemes/cobalt.css" />
# Or from the CDN
<link rel="stylesheet" href="https://dev.gtw.lt/jax-ui-kit/jax/css/jax.core.min.css" />
<link rel="stylesheet" href="https://dev.gtw.lt/jax-ui-kit/jax/css/schemes/cobalt.min.css" />
# Or bake a different default into jax.css
uv run jax-build --scheme cobalt
To let visitors switch at runtime, give the scheme link an id
and load scheme.js. Not needed for a single-scheme
site.
<link rel="stylesheet" href="/jax/css/jax.core.css" />
<link rel="stylesheet" id="jax-scheme"
href="/jax/css/schemes/ember.css"
data-schemes="cobalt,ember,mono,moss,teal,viola" />
<script src="/jax/js/scheme.js"></script>
// then: jax.scheme.set('moss')
FastAPI Integration
from fastapi import FastAPI
import jax_ui
app = FastAPI()
jax_ui.mount_static(app) # serves at /jax/
# In templates:
# <link rel="stylesheet" href="/jax/css/jax.css">
# <script src="/jax/js/theme.js"></script>
Jinja2 Macros
{# Import macros #}
{% from "jax/components.html" import btn, badge, card, alert, toggle %}
{# Use them #}
{{ btn("save", variant="primary", hx_post="/save") }}
{{ badge("OK", status="ok") }}
{{ alert("Done!", type="ok", title="Success") }}
{% call card(title="My Card") %}
Card content here.
{% endcall %}
Django Integration
# settings.py
import jax_ui
STATICFILES_DIRS = [
jax_ui.django_staticfiles_dir(),
]
# In templates:
{% load static %}
<link rel="stylesheet" href="{% static 'css/jax.css' %}">
<script src="{% static 'js/theme.js' %}"></script>
Plain HTML (no Python)
Clone the repo, run uv run jax-build, copy
dist/ files.
git clone https://git.gtw.lt/jax/jax-ui-kit.git
cd jax-ui-kit && uv run jax-build
# grab dist/jax.min.css and dist/jax.min.js