← Back to Demos
Loading Cavalry Player...

Shadow DOM Demo

Cavalry player encapsulated in Web Components

Loading scene...
Element structure:
<cavalry-shadow-player>
  #shadow-root (open)
    <canvas></canvas>

About this Demo

This demo showcases the Cavalry player running entirely within a Shadow DOM, demonstrating complete encapsulation.

The canvas element is hidden inside the shadow root, and styles are completely isolated from the main document. This is perfect for widget/component-based embedding.