Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.02 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.02 KB

UIX DOM

This library implements a standalone DOM subset based on Deno DOM that can be used in deno or in the browser.

UIX DOM also supports DATEX bindings for DOM elements from the UIX DOM library, as well as for normal browser DOM elements.

Example 1

Loading the DOM Context

To get started, import the context from "mod.ts":

import * as context from "../uix-dom/dom/mod.ts";

This context includes definitions for all Elements, as well as a document object. It can be used interchangably with the globalThis object in the browser.

Enabling DATEX bindings

By enabling DATEX bindings for a DOMContext object, the corresponding DATEX type definitions are mapped to the DOM context and reactivity is enabled.

import { enableDatexBindings } from "./datex-bindings/mod.ts";
const domUtils = enableDatexBindings(context);

Enabling JSX

import { enableJSX } from "./jsx/mod.ts";
const {jsx, jsxs, Fragment} = enableJSX(domUtils, context);