1.0.2 • Published 3 years ago

@fyn-software/remix-shadow-root v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@fyn-software/remix-shadow-root

Lets you add a declaritive shadow root to components, allowing you to use the shadow DOM. This provides scoped CSS.

Installation

npm i @fyn-software/remix-shadow-root

Usage

import React from 'react';
import RemixShadowRoot from '@fyn-software/remix-shadow-root';

export default function MyComponent()
{
    return <outer-element>
        <RemixShadowRoot>
            <h1>this is my awesome shadow DOM</h1>
        </RemixShadowRoot>
    </outer-element>
}

Props

PropTypeValuesDefaultDescription
modeStringopen or closedopenSets the mode of the shadow root.

Notes

  • A minimum of React 16 is required.
  • TypeScript definitions included and should not require configuration
  • Works in all modern browsers except non-Chromium Edge. Click here for current browser support.
  • Not all HTML elements allow you to attach a shadow root. Click here for more information.