Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-shadow

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-shadow

Utilise Shadow DOM in React with all the benefits of style encapsulation.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
70K
increased by113.77%
Maintainers
1
Weekly downloads
 
Created
Source

Screenshot

Travis   License MIT   Experimental

  • npm: npm i react-shadow --save
  • Heroku: http://react-shadow.herokuapp.com/

Getting Started

By using ReactShadow you have all the benefits of Shadow DOM in React.

import ShadowDOM from 'react-shadow';

export default props => {
    return (
        <ShadowDOM cssDocuments={['css/core/calendar.css', props.theme]}>
            <h1>Calendar</h1>
        </ShadowDOM>
    );
}

In the above example the h1 element will become the host element with a shadow boundary — and the two defined CSS documents will be fetched and appended.

Avoiding FOIC

As the CSS documents are being fetched over the network, the host element will have a className of resolving for you to avoid the dreaded FOIC. Once all of the documents have been attached the className will change to resolved.

Cached Documents

Where components share CSS documents, only one instance of the CSS document will be fetched due to memoize of the fetchStylesheet function.

Keywords

FAQs

Package last updated on 14 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc