# @kleutzinger/html-builder

> Build HTML elements using javascript

Latest version **0.0.8** (published 2023-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kleutzinger/html-builder
pnpm add @kleutzinger/html-builder
yarn add @kleutzinger/html-builder
bun add @kleutzinger/html-builder
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2023-10-06 |
| First published | 2023-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Leutzinger |
| Maintainers | kleutzinger |
| Keywords | html, builder |

## Links

- npm: https://www.npmjs.com/package/@kleutzinger/html-builder
- Repository: https://github.com/kleutzinger-forks/html-builder
- Issues: https://github.com/kleutzinger-forks/html-builder/issues
- npm.io page: https://npm.io/package/@kleutzinger/html-builder

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2023-10-06
- 0.0.7 — 2023-10-06
- 0.0.6 — 2023-10-06
- 0.0.5 — 2023-10-06

## README

JS to HTML string builder

forked from https://github.com/frango9000/html-builder to add a couple extra tags

Use Js to generate html strings

Install:

`npm i @kleutzinger/html-builder`

Usage:

`import {a,p,br,customTag} from '@kleutzinger/html-builder'`

.

.

.

## Simple tags:

`p("Paragraph")` Outputs: `<p>Paragraph</p>`

## With attributes:

`a({href: "google.com", "Link")` Outputs: `<a href="google.com">Link</p>`

## Self closing tags:

`img({src: "localhost"}, "Text")` Outputs: `<img url="localhost" />`

## Custom Tags:

`customTag("pre", {zindex: "0"}, "Text")` Outputs: `<pre zindex="0">Text</pre>`

## Supported Tags

- style
- title
- a
- h1
- h2
- h3
- h4
- h5
- h6
- p
- b
- i
- q
- strong
- em
- pre
- code
- div
- span
- table
- thead
- tbody
- tfoot
- tr
- td
- th
- colgroup
- caption
- ul
- ol
- li
- dt
- dd
- details
- summary
- option
- select
- textarea
- optgroup
- button

### Self Closing Tags

- area
- base
- br
- col
- embed
- hr
- img
- input
- link
- meta
- param
- source
- track
- wbr

---
_Source: https://npm.io/package/@kleutzinger/html-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
