Skip to content
🏳️‍⚧️ TRANSLUX is live — Track 530+ anti-LGBTQ+ bills, organize mutual aid, and build UIs that stand for something. Support the movement →

Usage & API

Bring the power of Translux and its FSM to your frontend stack.

The simplest way to use Translux without a framework adapter is to query your container elements and instantiate the engine.

import { Translux } from 'translux/core';
document.addEventListener('DOMContentLoaded', () => {
Translux.apply('.glass-panel', {
blurRadius: 12,
saturation: 150
});
});

Because Translux uses nested selectors and relies on physical interaction properties pointer-events, you should avoid placing Translux boundaries deeply inside pseudo-elements.

You can query the math and physics directly without mutating the DOM, retrieving the diffuse glow arrays.

const glowValues = Translux.compute({ lightDistance: 4, exponent: 1.2 });
element.style.boxShadow = glowValues.join(', ');