luna-dom-viewer
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Luna Dom Viewer

Dom tree navigator.

Demo

https://luna.liriliri.io/?path=/story/dom-viewer

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-dom-viewer/luna-dom-viewer.css" />
<script src="//cdn.jsdelivr.net/npm/luna-dom-viewer/luna-dom-viewer.js"></script>

You can also get it on npm.

npm install luna-dom-viewer --save
import 'luna-dom-viewer/luna-dom-viewer.css'
import LunaDomViewer from 'luna-dom-viewer'

Usage

const container = document.getElementById('container')
const domViewer = new LunaDomViewer(container)
domViewer.expand()

Configuration

  • hotkey(boolean): Enable hotkey.
  • ignore(AnyFn): Predicate function which removes the matching child nodes.
  • node(ChildNode): Html element to navigate.

Api

select(node?: ChildNode): void

Select given node.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.012latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.012
1.3.00
1.2.494
1.2.30
1.2.20
1.2.10
1.2.00
1.1.20
1.1.10
1.1.00
1.0.20
1.0.10
1.0.00
0.1.00

Package Sidebar

Install

npm i luna-dom-viewer

Weekly Downloads

106

Version

1.4.0

License

MIT

Unpacked Size

304 kB

Total Files

18

Last publish

Collaborators

  • surunzi