Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun
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
This package works with Browsers
JSR Score100%
Downloads2/wk
Published2 months ago (0.0.26)

Copy the contents of an element elsewhere in the DOM into this component.

mirror-element

mirror-element component on Storybook mirror-element version on JSR JSR score

Copy the innerHTML of any other element.

Using this package

Browser

<script src="https://esm.sh/jsr/@web-components/mirror-element" type="module"></script>

Deno

deno add jsr:@web-components/mirror-element

NPM

npx jsr add @web-components/mirror-element

Documentation

Copy the innerHTML of an element from somewhere else on the DOM.

Attributes

  • selector: The CSS selector of the element you want to copy.
  • strip-ids: If a mirror-element instance has this attribute it will remove all IDs from child elements.
  • disabled: Prevents automatic updates. Controlled updates can be done by calling render() on each element instance.

Styling

You might want to use display:contents in your CSS so that mirror-element instances don't produce a specific box in the DOM.


Made by jackcarey.

Built and signed on
GitHub Actions

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:@web-components/mirror-element

Import symbol

import * as mirror_element from "@web-components/mirror-element";
or

Import directly with a jsr specifier

import * as mirror_element from "jsr:@web-components/mirror-element";

Add Package

pnpm i jsr:@web-components/mirror-element
or (using pnpm 10.8 or older)
pnpm dlx jsr add @web-components/mirror-element

Import symbol

import * as mirror_element from "@web-components/mirror-element";

Add Package

yarn add jsr:@web-components/mirror-element
or (using Yarn 4.8 or older)
yarn dlx jsr add @web-components/mirror-element

Import symbol

import * as mirror_element from "@web-components/mirror-element";

Add Package

vlt install jsr:@web-components/mirror-element

Import symbol

import * as mirror_element from "@web-components/mirror-element";

Add Package

npx jsr add @web-components/mirror-element

Import symbol

import * as mirror_element from "@web-components/mirror-element";

Add Package

bunx jsr add @web-components/mirror-element

Import symbol

import * as mirror_element from "@web-components/mirror-element";