Component
A persistent TypeScript object associated with its real DOM. Lifecycle, events and content stay where you expect them.
object → DOMA TypeScript framework for dense, professional interfaces. Persistent objects, real DOM, typed events — and JSX when it makes the tree easier to read.
npm install x4jsControl Center · concept application built to show the kind of interface x4 is made for.
Most UI frameworks start with <div>.
Use the language and the browser when they already solve the problem. Add framework concepts only where they earn their place.
A persistent TypeScript object associated with its real DOM. Lifecycle, events and content stay where you expect them.
object → DOMObservable application state through Proxy. Read and mutate ordinary JavaScript-shaped data.
state.count++Local communication between components and objects. Typed, explicit, unsurprising.
button.on('click', ...)Application-wide messages. Transport can be local or remote without leaking into the views.
event ≠ transportComponents are persistent instances. Create them, keep references, call methods, listen to events. No render loop to appease.
class DevicePanel extends VBox {
constructor(props: DevicePanelProps) {
super(props);
this.setContent([
new Label({ text: props.name }),
new Gauge({ min: 0, max: 100 }),
new Button({ label: "Restart" })
]);
}
}x4 ships with more than 50 components, the CSS foundation they use, and a theme system based on CSS variables. Start with the defaults, create your own controls, or integrate third-party UI components when they fit the job.
From basic inputs and layouts to the controls real applications eventually need.
Your own controls use exactly the same Component model as the built-ins. A custom component is just a TypeScript class with the lifecycle and DOM you need.
class StatusBadge extends Component {
constructor(props: StatusBadgeProps) {
super(props);
this.setContent(props.text);
}
}
x4 does not require every control to come from x4. Third-party UI libraries can live alongside x4 components when they fit the job.
Component styles, layouts, visual states and theming are part of x4. The default theme is usable as-is and CSS variables keep product customization direct.
/* override theme variables */CSS variables · your CSS · same real DOMx4's natural habitat is software people work in: data-heavy screens, industrial tools, dashboards, business applications and desktop-like interfaces.
Tabular data is a first-class use case, backed by specialized DataStore structures.
Hierarchies and navigation for serious application shells.
Structured editing without rebuilding basic application controls yourself.
Live operational data fits naturally beside the rest of the interface.
JSX is optional syntax, not an application architecture. Use object construction for directness, JSX for readable trees — both create x4 Components and real DOM.
this.setContent([
new Label({ text: "Temperature" }),
new Gauge({ min: 0, max: 100 })
]);this.setContent(
<VBox>
<Label text="Temperature" />
<Gauge min={0} max={100} />
</VBox>
);The npm package ships TypeScript sources. Your bundler sees x4 and your application in the same module graph, so ordinary tree-shaking can remove components you never import.
x4 keeps the development loop short: TypeScript, integrated tooling and HMR for immediate feedback while you work.
$ npm install x4js
$ x4js create basic
$ cd basic
$ npm install
$ x4js build
server listening on 127.0.0.1:3000x4 includes a generated AI context with real API signatures. Agents can also inspect the TypeScript sources shipped in node_modules/x4js.