# @editorjs/dom

> Utils useful for work with dom for Editor.js tools development

Latest version **1.2.0** (published 2026-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @editorjs/dom
pnpm add @editorjs/dom
yarn add @editorjs/dom
bun add @editorjs/dom
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2026-09-29 |
| First published | 2024-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 98.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | codex-team |

## Links

- npm: https://www.npmjs.com/package/@editorjs/dom
- Repository: https://github.com/editor-js/utils/tree/main/packages/dom
- npm.io page: https://npm.io/package/@editorjs/dom

## Dependencies (1)

- [@editorjs/helpers](https://npm.io/package/@editorjs/helpers.md) ^1.2.2

## Recent versions

- 1.2.0 (latest) — 2026-09-29
- 1.1.0 — 2026-04-15
- 1.0.1 — 2024-11-06
- 1.0.0 — 2024-08-23
- 0.0.12 — 2024-08-23
- 0.0.11 — 2024-08-23
- 0.0.10 — 2024-08-23
- 0.0.9 — 2024-08-22
- 0.0.8 — 2024-08-22
- 0.0.7 — 2024-08-20
- 0.0.6 — 2024-08-20
- 0.0.5 — 2024-08-20
- 0.0.4 — 2024-08-17
- 0.0.3 — 2024-08-17
- 0.0.2 — 2024-08-17
- … 1 more at https://npm.io/package/@editorjs/dom/versions

## README

# @editorjs/dom
Utils useful for work with dom for Editor.js tools development
### Installation 
 ```
   npm install @editorjs/dom
```
### Function list
- [allInputsSelector](https://github.com/editor-js/utils/blob/main/packages/dom/src/allInputsSelector/allInputsSelector.ts) - Returns CSS selector for all text inputs
- [append](https://github.com/editor-js/utils/blob/main/packages/dom/src/append/append.ts) - Append one or several elements to the parent
- [blockElements](https://github.com/editor-js/utils/blob/main/packages/dom/src/blockElements/blockElements.ts) - Return array of names of block html elements
- [calculateBaseline](https://github.com/editor-js/utils/blob/main/packages/dom/src/calculateBaseline/calculateBaseline.ts) - Calculates the Y coordinate of the text baseline from the top of the element's margin box,
- [canSetCaret](https://github.com/editor-js/utils/blob/main/packages/dom/src/canSetCaret/canSetCaret.ts) - Checks if we can set caret
- [containsOnlyInlineElements](https://github.com/editor-js/utils/blob/main/packages/dom/src/containsOnlyInlineElements/containsOnlyInlineElements.ts) - Check if passed content includes only inline elements
- [DomIterator](https://github.com/editor-js/utils/blob/main/packages/dom/src/domIterator/domIterator.ts) - Iterator over passed Elements list.
- [findAllInputs](https://github.com/editor-js/utils/blob/main/packages/dom/src/findAllInputs/findAllInputs.ts) - Find all contenteditable, textarea and editable input elements passed holder contains
- [Flipper](https://github.com/editor-js/utils/blob/main/packages/dom/src/flipper/flipper.ts) - Flipper is a component that iterates passed items array by TAB or Arrows and clicks it by ENTER
- [fragmentToString](https://github.com/editor-js/utils/blob/main/packages/dom/src/fragmentToString/fragmentToString.ts) - Returns the HTML content of passed Document Fragment
- [getContentLength](https://github.com/editor-js/utils/blob/main/packages/dom/src/getContentLength/getContentLength.ts) - Return length of node`s text content
- [getDeepestBlockElements](https://github.com/editor-js/utils/blob/main/packages/dom/src/getDeepestBlockElements/getDeepestBlockElements.ts) - Find and return all block elements in the passed parent (including subtree)
- [getDeepestNode](https://github.com/editor-js/utils/blob/main/packages/dom/src/getDeepestNode/getDeepestNode.ts) - Search for deepest node which is Leaf.
- [isCollapsedWhitespaces](https://github.com/editor-js/utils/blob/main/packages/dom/src/isCollapsedWhitespaces/isCollapsedWhitespaces.ts) - Determine whether a passed text content is a collapsed whitespace.
- [isContentEditable](https://github.com/editor-js/utils/blob/main/packages/dom/src/isContentEditable/isContentEditable.ts) - Check if passed element is contenteditable
- [isElement](https://github.com/editor-js/utils/blob/main/packages/dom/src/isElement/isElement.ts) - Check if object is DOM node
- [isEmpty](https://github.com/editor-js/utils/blob/main/packages/dom/src/isEmpty/isEmpty.ts) - breadth-first search (BFS)
- [isFragment](https://github.com/editor-js/utils/blob/main/packages/dom/src/isFragment/isFragment.ts) - Check if object is DocumentFragment node
- [isHTMLString](https://github.com/editor-js/utils/blob/main/packages/dom/src/isHtmlString/isHtmlString.ts) - Check if string contains html elements
- [isLeaf](https://github.com/editor-js/utils/blob/main/packages/dom/src/isLeaf/isLeaf.ts) - checks node if it is doesn't have any child nodes
- [isLineBreakTag](https://github.com/editor-js/utils/blob/main/packages/dom/src/isLineBreakTag/isLineBreakTag.ts) - Check if element is BR or WBR
- [isMobileScreen](https://github.com/editor-js/utils/blob/main/packages/dom/src/isMobileScreen/isMobileScreen.ts) - True if screen has mobile size
- [isNativeInput](https://github.com/editor-js/utils/blob/main/packages/dom/src/isNativeInput/isNativeInput.ts) - Checks target if it is native input
- [isNodeEmpty](https://github.com/editor-js/utils/blob/main/packages/dom/src/isNodeEmpty/isNodeEmpty.ts) - Checks node if it is empty
- [isSingleTag](https://github.com/editor-js/utils/blob/main/packages/dom/src/isSingleTag/isSingleTag.ts) - Check if passed tag has no closed tag
- [make](https://github.com/editor-js/utils/blob/main/packages/dom/src/make/make.ts) - Helper for making Elements with class name and attributes
- [offset](https://github.com/editor-js/utils/blob/main/packages/dom/src/offset/offset.ts) - Return element's offset related to the document
- [prepend](https://github.com/editor-js/utils/blob/main/packages/dom/src/prepend/prepend.ts) - Append element or a couple to the beginning of the parent elements
# About CodeX
   <img align="right" width="120" height="120" src="https://codex.so/public/app/img/codex-logo.svg" hspace="50">

   CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are [open](https://codex.so/join) for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.

  | 🌐 | Join  👋  | Twitter | Instagram |
   | -- | -- | -- | -- | 
   | [codex.so](https://codex.so) | [codex.so/join](https://codex.so/join) |[@codex_team](http://twitter.com/codex_team) | [@codex_team](http://instagram.com/codex_team/) |

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