Skip to main content

Frontend development · Intermediate · 25 min

Build a reusable web component with custom elements and shadow DOM

By Padding · Updated 18 Nov 2026
Modern browsers · Custom Elements and Shadow DOM (HTML and DOM Living Standards) · checked in Chromium with Playwright 1.65.1 on Node.js 26

You will build a framework-free copy-button element in one JavaScript file, with scoped styles, a slotted label, theming from outside, a copied event and a browser test that uses it by keyboard.

On this page

A copy button is a small thing that turns up everywhere: next to an invite link, a payment reference, an API key or a code sample. Teams often rebuild it in each framework they use, and each copy behaves a little differently. A web component is a way to build it once, as a real HTML element the browser understands, and use the same file in a plain page, a React app, a Vue app or a CMS template.

In this tutorial you build <copy-button> with no framework and no build step. Three browser features do the work:

  • Custom elements let you register a new tag name and attach a class to it, with callbacks the browser calls when the element enters or leaves the page and when its attributes change.
  • Shadow DOM gives the element a private piece of DOM with its own styles, so page CSS cannot break it and its CSS cannot leak out.
  • Slots, parts and custom properties are the deliberate holes in that privacy: a slot lets the page supply the label, while parts and custom properties let the page restyle chosen pieces.

Inside, the element is a real <button>, so focus, Enter and Space, and the button role for screen readers all come from the browser instead of your code. The finished file is about 90 lines and loads with one <script> tag, which also matters on a low-end Android phone on prepaid data, where every kilobyte of framework you skip is a kilobyte nobody pays for.

Step 1 · Register an empty element

Make a demo folder with three files: the page, the page's own CSS and the component. The page uses <copy-button> twice, with the text to copy in a value attribute and the label as the element's content.

Bash
mkdir -p ~/copy-button-demo
cd ~/copy-button-demo
cat > index.html <<'HTML'
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Copy button demo</title>
  <link rel="stylesheet" href="page.css">
  <script src="copy-button.js" defer></script>
</head>
<body>
  <main>
    <h1>Invite your team</h1>
    <p>Share this link with people who should join the workspace.</p>
    <p><code>https://example.com/join/7Q2K-4XNB</code></p>
    <copy-button id="invite" value="https://example.com/join/7Q2K-4XNB">Copy invite link</copy-button>

    <h2>Pay by transfer</h2>
    <p>Use this reference for a bank transfer or mobile money payment: <code>PAY-58213</code></p>
    <copy-button id="ref" value="PAY-58213" copied-label="Reference copied">Copy reference</copy-button>

    <p><button type="button">An ordinary page button</button></p>
    <p id="log"></p>
  </main>
  <script>
    document.addEventListener('copied', (event) => {
      document.querySelector('#log').textContent = `Last copied: ${event.detail.value}`;
    });
  </script>
</body>
</html>
HTML
cat > page.css <<'CSS'
body {
  margin: 0;
  background: #f6f7f8;
  color: #1b1f24;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}
main { max-width: 36rem; margin: 0 auto; padding: 1rem; }
code { overflow-wrap: anywhere; }

/* A careless global rule, to prove the component is protected from it. */
button {
  border: 3px dotted #b42318;
  background: #ffffff;
  padding: 0.5rem 1rem;
  font: inherit;
}

/* Hide the elements until their definition has loaded. */
copy-button:not(:defined) { visibility: hidden; }
CSS
cat > copy-button.js <<'JS'
class CopyButton extends HTMLElement {}

customElements.define('copy-button', CopyButton);
JS

A few rules apply to every custom element:

  • The name must contain a hyphen. copy-button is valid, copybutton is not. The hyphen guarantees your name never clashes with a future built-in HTML element.
  • The class extends HTMLElement. That makes it an autonomous custom element: a brand new tag with its own behaviour.
  • The page can use the tag before it is defined. The browser treats <copy-button> as an unknown element until customElements.define runs, then upgrades every one already on the page. The :not(:defined) rule hides them until then. A copy button cannot copy without its script, so hiding it is better than showing a label that does nothing.

The script is a classic script with defer, not type="module". Chromium blocks module scripts on pages opened straight from disk (file://), and a classic deferred script runs at the same point a module would: after the page is parsed.

Check it worked

Open index.html in your browser (open index.html on macOS, xdg-open index.html on Linux, or drag the file into a window). Both labels show as plain text, Copy invite link and Copy reference, not as buttons yet, and the ordinary page button has a thick red dotted border. Open the developer tools console and run customElements.get('copy-button'): it prints the CopyButton class. Run document.querySelector('#invite') instanceof HTMLElement and it prints true.

Step 2 · Give it a shadow root with a real button

Now give the element its insides. The structure lives in a <template>, which the browser parses once. Each <copy-button> clones it into its own shadow root in the constructor.

Replace copy-button.js:

Bash
cd ~/copy-button-demo
cat > copy-button.js <<'JS'
{
  const template = document.createElement('template');
  template.innerHTML = `
    <style>
      :host {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
      }
      :host([hidden]) { display: none; }
      button {
        min-height: 2.75rem;
        padding: 0.5rem 1rem;
        border: 2px solid transparent;
        border-radius: 0.5rem;
        background: #1b1f24;
        color: #ffffff;
        font: inherit;
        font-weight: 600;
        cursor: pointer;
      }
      button:focus-visible {
        outline: 3px solid #1b1f24;
        outline-offset: 2px;
      }
      .status { font-size: 0.875rem; }
    </style>
    <button type="button" part="button"><slot>Copy</slot></button>
    <span class="status" part="status" role="status"></span>
  `;

  class CopyButton extends HTMLElement {
    constructor() {
      super();
      const root = this.attachShadow({ mode: 'open', delegatesFocus: true });
      root.append(template.content.cloneNode(true));
    }
  }

  customElements.define('copy-button', CopyButton);
}
JS

What each part does:

  • The outer braces make a block, so template and CopyButton stay out of the page's global scope even though this is a classic script.
  • attachShadow({ mode: 'open' }) creates the shadow root. Open means page scripts can still reach it through element.shadowRoot, which helps debugging and testing. delegatesFocus: true sends focus to the inner button when something focuses the host, for example element.focus() or a click on the gap beside it.
  • <slot> is where the element's own content, Copy invite link, is shown. The text stays in the page's DOM, so it can be translated, searched and read like any other page text. Copy inside the slot is fallback content, used when the element is empty.
  • :host styles the <copy-button> element itself from inside. :host([hidden]) is needed because the display: inline-flex rule would otherwise beat the browser's own [hidden] { display: none } and the hidden attribute would stop working.
  • role="status" on the empty span makes it a polite live region. Text put into it later is announced by most screen readers without moving focus.
  • part="button" and part="status" do nothing yet. They are the names the page will use for theming in a later step.

Because the label sits inside a real <button>, the button's accessible name is the slotted text, it is in the tab order, and Enter and Space activate it. You wrote none of that.

Check it worked

Reload. Both labels are now dark buttons with white text, and a note of what did not happen: the global button rule in page.css gave the ordinary page button a red dotted border, but the two copy buttons have no dotted border at all. Page selectors do not reach into a shadow root. Inherited properties do cross the boundary, which is why the copy buttons use the page's system-ui font through font: inherit.

In the developer tools Elements panel, expand <copy-button id="invite">: you see #shadow-root (open) with the style, button, slot and span inside, and the text Copy invite link still sits outside it in the light DOM. Press Tab from the top of the page: focus lands on Copy invite link and shows a dark ring. Pressing Enter does nothing yet.

Step 3 · Copy on click and announce it

Now add the behaviour. Two lifecycle callbacks matter here. The browser calls connectedCallback each time the element is inserted into a document, and disconnectedCallback each time it is removed. Listeners and timers that should only run while the element is on the page belong in these two, so a removed element leaves nothing running behind it.

Replace copy-button.js with this version. The template is unchanged; the class gains the copy logic:

Bash
cd ~/copy-button-demo
cat > copy-button.js <<'JS'
{
  const template = document.createElement('template');
  template.innerHTML = `
    <style>
      :host {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
      }
      :host([hidden]) { display: none; }
      button {
        min-height: 2.75rem;
        padding: 0.5rem 1rem;
        border: 2px solid transparent;
        border-radius: 0.5rem;
        background: #1b1f24;
        color: #ffffff;
        font: inherit;
        font-weight: 600;
        cursor: pointer;
      }
      button:focus-visible {
        outline: 3px solid #1b1f24;
        outline-offset: 2px;
      }
      .status { font-size: 0.875rem; }
    </style>
    <button type="button" part="button"><slot>Copy</slot></button>
    <span class="status" part="status" role="status"></span>
  `;

  class CopyButton extends HTMLElement {
    #button;
    #status;
    #timer;

    constructor() {
      super();
      const root = this.attachShadow({ mode: 'open', delegatesFocus: true });
      root.append(template.content.cloneNode(true));
      this.#button = root.querySelector('button');
      this.#status = root.querySelector('.status');
    }

    connectedCallback() {
      this.#button.addEventListener('click', this.#copy);
    }

    disconnectedCallback() {
      this.#button.removeEventListener('click', this.#copy);
      this.#setStatus('');
    }

    #copy = async () => {
      const text = this.getAttribute('value') ?? '';
      try {
        await navigator.clipboard.writeText(text);
      } catch {
        this.#setStatus('Could not copy');
        return;
      }
      this.#setStatus(this.getAttribute('copied-label') ?? 'Copied');
      this.dispatchEvent(new CustomEvent('copied', {
        bubbles: true,
        composed: true,
        detail: { value: text },
      }));
    };

    #setStatus(message) {
      clearTimeout(this.#timer);
      this.#status.textContent = message;
      if (message) {
        this.#timer = setTimeout(() => { this.#status.textContent = ''; }, 4000);
      }
    }
  }

  customElements.define('copy-button', CopyButton);
}
JS

How the pieces fit:

  • #copy is an arrow function stored in a private field, so this always points at the element and the same function reference is passed to addEventListener and removeEventListener. Adding the same listener twice is ignored, so moving the element around the page never doubles the clicks.
  • navigator.clipboard.writeText returns a promise, and it can be refused: the Clipboard API only exists on secure pages (https, localhost and, in most browsers, files opened from disk), and a browser may block it. The catch turns a refusal into the visible message Could not copy instead of a silent failure.
  • The status text goes into the live region and clears itself after four seconds. clearTimeout first means a second click restarts the timer instead of clearing the new message early, and disconnectedCallback clears it so no timer outlives the element.
  • copied-label lets the page supply the success message in its own words or language, the same way the slot supplies the label. A page in French or Swahili sets both and the component never shows English the page did not ask for.
  • The copied event tells the page something happened, with the copied text in detail. bubbles: true lets one listener on document hear every copy button. composed: true lets the event cross out of a shadow root, which matters when someone puts your copy-button inside their own component.

Check it worked

Reload and click Copy invite link. Copied appears beside the button, the line Last copied: https://example.com/join/7Q2K-4XNB appears at the bottom of the page, and pasting into the address bar or a text editor gives the link. After four seconds Copied disappears. Click Copy reference: the message is Reference copied and pasting gives PAY-58213. Press Tab until the invite button has focus and press Space: it copies again.

If you see Could not copy instead, your browser does not allow clipboard access on pages opened from disk. Run python3 -m http.server 8000 in the folder, open http://localhost:8000, and try again.

Step 4 · React to attribute changes

At the moment the element reads value only at the moment of a click. That is fine for copying, but two cases need a reaction straight away. When the page sets disabled, the inner button must become disabled, or keyboard users can still press it. And when value changes, a Copied message still showing refers to the old text and should go.

The browser only reports changes to the attributes a class lists in observedAttributes. For each one it calls attributeChangedCallback with the name, old value and new value. Replace copy-button.js with the final version:

Bash
cd ~/copy-button-demo
cat > copy-button.js <<'JS'
// copy-button.js: a <copy-button> custom element with no dependencies.
// Usage: <script src="copy-button.js" defer></script>
//        <copy-button value="text to copy">Label</copy-button>
{
  const template = document.createElement('template');
  template.innerHTML = `
    <style>
      :host {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
      }
      :host([hidden]) { display: none; }
      button {
        min-height: 2.75rem;
        padding: 0.5rem 1rem;
        border: 2px solid transparent;
        border-radius: var(--copy-button-radius, 0.5rem);
        background: var(--copy-button-bg, #1b1f24);
        color: var(--copy-button-fg, #ffffff);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
      }
      button:focus-visible {
        outline: 3px solid var(--copy-button-focus, #1b1f24);
        outline-offset: 2px;
      }
      button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
      }
      .status { font-size: 0.875rem; }
    </style>
    <button type="button" part="button"><slot>Copy</slot></button>
    <span class="status" part="status" role="status"></span>
  `;

  class CopyButton extends HTMLElement {
    static observedAttributes = ['value', 'disabled'];

    #button;
    #status;
    #timer;

    constructor() {
      super();
      const root = this.attachShadow({ mode: 'open', delegatesFocus: true });
      root.append(template.content.cloneNode(true));
      this.#button = root.querySelector('button');
      this.#status = root.querySelector('.status');
    }

    connectedCallback() {
      this.#button.addEventListener('click', this.#copy);
    }

    disconnectedCallback() {
      this.#button.removeEventListener('click', this.#copy);
      this.#setStatus('');
    }

    attributeChangedCallback(name, oldValue, newValue) {
      if (name === 'disabled') {
        this.#button.disabled = newValue !== null;
      } else if (name === 'value' && oldValue !== newValue) {
        this.#setStatus('');
      }
    }

    get value() {
      return this.getAttribute('value') ?? '';
    }

    set value(text) {
      this.setAttribute('value', text);
    }

    #copy = async () => {
      const text = this.value;
      try {
        await navigator.clipboard.writeText(text);
      } catch {
        this.#setStatus('Could not copy');
        return;
      }
      this.#setStatus(this.getAttribute('copied-label') ?? 'Copied');
      this.dispatchEvent(new CustomEvent('copied', {
        bubbles: true,
        composed: true,
        detail: { value: text },
      }));
    };

    #setStatus(message) {
      clearTimeout(this.#timer);
      this.#status.textContent = message;
      if (message) {
        this.#timer = setTimeout(() => { this.#status.textContent = ''; }, 4000);
      }
    }
  }

  if (!customElements.get('copy-button')) {
    customElements.define('copy-button', CopyButton);
  }
}
JS

What changed:

  • static observedAttributes names value and disabled. The browser ignores changes to any other attribute, which keeps the callback cheap.
  • attributeChangedCallback mirrors disabled onto the inner button and clears a stale message when value changes. An attribute that is removed arrives as null, which is why the check is newValue !== null and not a truthiness test: disabled="" is an empty string but still means disabled.
  • The callback also runs for attributes already in the HTML when an element is upgraded, before connectedCallback. That is why the button is created in the constructor: by the time the browser reports disabled, #button already exists.
  • A value property reads and writes the attribute. Frameworks such as React 19 and Vue set properties on custom elements when one exists, so el.value = '...' and value="..." both work.
  • The customElements.get guard stops an error if the file is loaded twice, for example by two parts of a CMS page. Defining the same name twice throws.
  • The colours, radius and focus ring now read CSS custom properties with the old values as fallbacks. Nothing looks different yet; the next step uses them.

Check it worked

Reload and run this in the console:

JavaScript
const invite = document.querySelector('#invite');
invite.setAttribute('disabled', '');

The invite button fades and the cursor shows "not allowed" over it. Press Tab from the top of the page: focus skips it and lands on Copy reference. Run invite.removeAttribute('disabled') and it works again. Now click it so Copied shows, then run invite.value = 'https://example.com/join/NEW1-2345': the message disappears at once, and the next click copies the new link.

Step 5 · Theme it from the page

The shadow root keeps page CSS out, so theming needs doors you choose to open. There are two, and they suit different jobs:

  • CSS custom properties inherit through the shadow boundary. The component reads --copy-button-bg, --copy-button-fg, --copy-button-focus and --copy-button-radius, and the page sets them on the element or any ancestor. Use these for values you expect people to change, such as brand colours.
  • ::part() lets the page write any CSS for an element marked with part="...". Page rules on a part win over the component's own normal rules for that element. Use it as an escape hatch when someone needs a change you did not plan for.

Append a theme for the payment reference button to page.css:

Bash
cd ~/copy-button-demo
cat >> page.css <<'CSS'

#ref {
  --copy-button-bg: #ffffff;
  --copy-button-fg: #0f5e5a;
  --copy-button-focus: #0f5e5a;
  --copy-button-radius: 999px;
}
#ref::part(button) {
  border-color: #0f5e5a;
  letter-spacing: 0.02em;
}
#ref::part(status) {
  color: #0f5e5a;
  font-weight: 600;
}
CSS

The custom properties change the colours and the radius. The border-color on ::part(button) beats the component's own border: 2px solid transparent, so the pill gets a visible teal edge. Notice what the page still cannot do: #ref button or #ref .status match nothing, because those selectors would need to see inside the shadow root. Only the two parts are open.

Write down the public surface somewhere your team will see it, such as a comment at the top of the file or a README beside it: the value, disabled and copied-label attributes, the copied event, the four custom properties and the button and status parts. Everything else is internal, and you can change it without breaking anyone.

Check it worked

Reload. Copy reference is now a white pill with teal text and a teal edge, while Copy invite link keeps the dark default. Click Copy reference: Reference copied appears in bold teal. Press Tab to reach it: the focus ring is teal too.

Step 6 · Test the element by keyboard

A test keeps all of this working when someone edits the component later. Install Playwright, which drives a real browser from a script, into the demo folder. --with-deps also installs the system libraries Chromium needs on Linux, which can ask for your password:

Bash
cd ~/copy-button-demo
npm init -y > /dev/null
npm install playwright@1.65.1
npx playwright install --with-deps chromium

A browser in a test has no person at the keyboard and no shared clipboard to paste from, so the test swaps navigator.clipboard for a small stand-in that records what it was given, and can be told to refuse once. Everything else runs for real. Write the test:

Bash
cd ~/copy-button-demo
cat > test-copy-button.mjs <<'JS'
import { chromium } from 'playwright';
import assert from 'node:assert/strict';

const url = new URL('./index.html', import.meta.url).href;
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 360, height: 740 } });

// A stand-in clipboard that records copied text and can refuse once.
await page.addInitScript(() => {
  window.copiedText = [];
  window.refuseNextCopy = false;
  Object.defineProperty(navigator, 'clipboard', {
    configurable: true,
    value: {
      writeText: async (text) => {
        if (window.refuseNextCopy) {
          window.refuseNextCopy = false;
          throw new Error('refused');
        }
        window.copiedText.push(text);
      },
    },
  });
});
await page.goto(url);

// Registered, with an open shadow root.
assert.equal(await page.evaluate(() => customElements.get('copy-button')?.name), 'CopyButton');
assert.ok(await page.evaluate(() => document.querySelector('#invite').shadowRoot !== null));

// The slotted label is the accessible name of a real button.
const invite = page.getByRole('button', { name: 'Copy invite link' });
const ref = page.getByRole('button', { name: 'Copy reference' });
await invite.waitFor();
await ref.waitFor();

// The page's global button rule does not reach inside the shadow root.
const borderOf = (locator) => locator.evaluate((el) => getComputedStyle(el).borderTopStyle);
assert.equal(await borderOf(page.getByRole('button', { name: 'An ordinary page button' })), 'dotted');
assert.equal(await borderOf(invite), 'solid');

// Keyboard only: Tab to the first copy button and press Enter.
await page.keyboard.press('Tab');
assert.ok(await invite.evaluate((el) => el.getRootNode().activeElement === el), 'Tab reaches the inner button');
await page.keyboard.press('Enter');
await page.locator('#invite').getByRole('status').filter({ hasText: 'Copied' }).waitFor();
assert.deepEqual(await page.evaluate(() => window.copiedText), ['https://example.com/join/7Q2K-4XNB']);
assert.equal(await page.locator('#log').textContent(), 'Last copied: https://example.com/join/7Q2K-4XNB');

// The page's own success message, then a refused copy.
await ref.click();
await page.locator('#ref').getByRole('status').filter({ hasText: 'Reference copied' }).waitFor();
await page.evaluate(() => { window.refuseNextCopy = true; });
await ref.click();
await page.locator('#ref').getByRole('status').filter({ hasText: 'Could not copy' }).waitFor();
assert.equal(await page.locator('#log').textContent(), 'Last copied: PAY-58213', 'no event for a refused copy');

// disabled is observed and mirrored onto the inner button.
await page.evaluate(() => document.querySelector('#invite').setAttribute('disabled', ''));
assert.ok(await invite.isDisabled());
await page.evaluate(() => document.querySelector('#invite').removeAttribute('disabled'));
assert.ok(await invite.isEnabled());

// Moving the element disconnects and reconnects it: one click, one event.
await page.evaluate(() => {
  window.copiedEvents = 0;
  document.addEventListener('copied', () => { window.copiedEvents += 1; });
  const el = document.querySelector('#invite');
  el.remove();
  document.querySelector('main').append(el);
});
assert.equal(await page.locator('#invite').getByRole('status').textContent(), '', 'message cleared on disconnect');
await invite.click();
await page.locator('#invite').getByRole('status').filter({ hasText: 'Copied' }).waitFor();
assert.equal(await page.evaluate(() => window.copiedEvents), 1);

// A new value clears the old message, and the property copies the new text.
await page.evaluate(() => { document.querySelector('#invite').value = 'https://example.com/join/NEW1-2345'; });
assert.equal(await page.locator('#invite').getByRole('status').textContent(), '');
await invite.click();
await page.locator('#invite').getByRole('status').filter({ hasText: 'Copied' }).waitFor();
assert.equal(await page.evaluate(() => window.copiedText.at(-1)), 'https://example.com/join/NEW1-2345');

// Theming from outside: custom properties and ::part.
const look = await ref.evaluate((el) => {
  const s = getComputedStyle(el);
  return { bg: s.backgroundColor, fg: s.color, edge: s.borderTopColor, radius: s.borderTopLeftRadius };
});
assert.deepEqual(look, { bg: 'rgb(255, 255, 255)', fg: 'rgb(15, 94, 90)', edge: 'rgb(15, 94, 90)', radius: '999px' });
assert.equal(await invite.evaluate((el) => getComputedStyle(el).backgroundColor), 'rgb(27, 31, 36)');

// A comfortable target, and no sideways scrolling on a small phone.
assert.ok((await invite.boundingBox()).height >= 44);
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > document.documentElement.clientWidth), false);

await browser.close();
console.log('PASS: copy-button works by keyboard and mouse');
JS
node test-copy-button.mjs

Playwright's role and CSS locators look inside open shadow roots, so getByRole('button', { name: 'Copy invite link' }) finds the inner button by the same role and name a screen reader is given. If someone breaks the slot or the button, the test fails. The viewport is 360 by 740 pixels, a common size for budget Android phones.

Check it worked

The last line of output is PASS: copy-button works by keyboard and mouse. To see it fail for the right reason, delete 'disabled' from observedAttributes in copy-button.js and run node test-copy-button.mjs again: it stops with an AssertionError at the isDisabled check and prints no PASS line. Put it back and the test passes again.

Step 7 · Use the file anywhere, then clean up

copy-button.js is the whole component. To use it elsewhere, copy the file next to your page and add the same two lines you used here:

HTML
<script src="copy-button.js" defer></script>
<copy-button value="text to copy">Copy</copy-button>

In a bundled app (Vite, Next.js, Nuxt and others) import it once for its side effect, import './copy-button.js';, and use <copy-button> in your templates. Listen for the event with addEventListener('copied', ...) on the element or an ancestor. In a server-rendered app, import it only in code that runs in the browser, because HTMLElement and customElements do not exist on the server.

When you are done, remove the demo folder, which also removes the local Playwright install. The browser Playwright downloaded stays in its shared cache; npx playwright uninstall removes that too if you no longer need it.

Bash
cd ~
rm -rf ~/copy-button-demo

Check it worked

ls ~/copy-button-demo reports that there is no such file or directory.

Next steps

You wrote the template, the attribute handling and the re-rendering by hand. That is fine for one small element. For a set of components with more state, Lit is a small library built on these same standards: it adds reactive properties, efficient template updates and scoped styles while still producing ordinary custom elements. What you learned here is what Lit does underneath.

Need this done for you?

Padding does this work for growing companies, from the first diagnosis to a system that keeps working.

Digital Transformation

Get new tutorials

New tutorials, about twice a month.