Skip to main content

Built and signed on GitHub Actions

An HTML rendering library in JSX.

It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
88%
Published
6 months ago (0.0.9)

@fartlabs/htx

GitHub Actions

Render HTML components with JSX powered by Deno and @fartlabs/jsonx.

API documentation

Generated API documentation is available at https://jsr.io/@fartlabs/htx.

Getting started

Deno

Let's learn how to get started with htx by creating a simple router in Deno.

1. Install Deno.

2. Start a new Deno project.

deno init

3. Add @fartlabs/htx as a project dependency.

deno add jsr:@fartlabs/htx

4. Add the following values to your deno.json(c) file.

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "@fartlabs/htx"
  }
}

5. Add a file ending in .[j|t]sx to your project. For example, main.tsx.

import { A, BODY, H1, P } from "@fartlabs/htx";

const html = (
  <BODY>
    <H1>Hello, World!</H1>
    <P>This is a paragraph.</P>
    <A href="https://jsr.io/@fartlabs/htx">@fartlabs/htx</A>
  </BODY>
);

Deno.writeTextFileSync("index.html", html);

6. Compile your HTML by running the .[j|t]sx file.

deno run --allow-net main.tsx

Resulting index.html:

<body>
  <h1>Hello, World!</h1>
  <p>This is a paragraph.</p>
  <a href="https://jsr.io/@fartlabs/htx">@fartlabs/htx</a>
</body>

Contribute

Style

Run deno fmt to format the code.

Run deno lint to lint the code.

Code generation

Run deno task generate to generate the code.


Developed with ❤️ @FartLabs

Built and signed on
GitHub Actions
View transparency log

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fartlabs/htx

Import symbol

import * as htx from "@fartlabs/htx";
or

Import directly with a jsr specifier

import * as htx from "jsr:@fartlabs/htx";

Add Package

pnpm i jsr:@fartlabs/htx
or (using pnpm 10.8 or older)
pnpm dlx jsr add @fartlabs/htx

Import symbol

import * as htx from "@fartlabs/htx";

Add Package

yarn add jsr:@fartlabs/htx
or (using Yarn 4.8 or older)
yarn dlx jsr add @fartlabs/htx

Import symbol

import * as htx from "@fartlabs/htx";

Add Package

npx jsr add @fartlabs/htx

Import symbol

import * as htx from "@fartlabs/htx";

Add Package

bunx jsr add @fartlabs/htx

Import symbol

import * as htx from "@fartlabs/htx";