Skip to content
V

vue-shadow-dom

Shadow dom support for Vue

by cc2aFree

#1228in UI Libraries
0In stores

Description

Shadow is a library that adds Shadow DOM support to Vue, so a component can render its contents inside a shadow root. The shadow element tak…

Highlights

  • Renders Vue content inside a shadow root
  • Shadow style element for component styles
  • tag and abstract props
  • Builds for bundlers, import maps, CDN and Node
  • Experimental adoptedStyleSheets option

Ratings & Reviews

No ratings yet

Be the first to rate vue-shadow-dom.

People also visit

W

@webcomponents/shadycss

ShadowDOM style encapsulation shim

UI Libraries
Launch
V

Vue (shadcn-vue)

Vue port of shadcn/ui

UI Libraries
Launch
W

@webcomponents/shadydom

Web Components Polyfills

UI Libraries
Launch
L

@lwc/synthetic-shadow

Shadow DOM polyfill by LWC

UI Libraries
Launch
S

shadow-dom-testing-library

An extension of DOM-testing-library to provide hooks into the shadow dom

UI Libraries
Launch
V

vue-word-highlighter

The word highlighter library for Vue 2 and Vue 3

UI Libraries
Launch

vue-shadow-dom FAQ

What is Shadow for?

It gives Vue components a Shadow DOM, so their markup and styles are kept separate from the rest of the page.

Which Vue version is it for?

The current release targets Vue 3. The README says Vue 2 projects should use version 1.x.

How do I add styles?

Use the shadow-style element, which works like an HTML style tag. The README explains that this is needed because Vue single-file components disable the style tag.

Is the v-shadow directive still recommended?

No. The README marks the v-shadow directive as deprecated.

Can I use it without a build step?

Yes. The dist folder includes a global script and browser builds for import maps and CDNs, so you can load it directly in a page.

What are the best vue-shadow-dom alternatives?

Popular alternatives to vue-shadow-dom include @webcomponents/shadycss, Vue (shadcn-vue) and @webcomponents/shadydom. See all vue-shadow-dom alternatives

Developer Stuff

Badges