importReactfrom"react";import{render}from"react-dom";import{ThemeProvider}from"photoncss/react";// Import Photon in to the projectimport"photoncss/dist/photon.css";// Import the Photon stylesheet// Create the root elementexportfunctionRoot(){return(<ThemeProviderglobal><p>PhotonCSSDemo</p></ThemeProvider>);}// Wait for the DOM to load before renderingdocument.addEventListener("DOMContentLoaded",function(){// Append a container to the DOM to render content intoconstroot=document.createElement("DIV");root.id="root";document.body.append(root);// Render root component into react-root containerrender(<Root/>,document.getElementById("root"));});
Importing components
All components are imported from the module photoncss/react.