@omnicar/sam-modal

A Modal component for React

Usage no npm install needed!

<script type="module">
  import omnicarSamModal from 'https://cdn.skypack.dev/@omnicar/sam-modal';
</script>

README

SamModal

SAM React component for displaying a Modal dialogue.

Example usage

state = {
  isVisible: true
};
hideCb = () => { this.setState({isVisible: false}); }

// render function inside React component
render() {
  const html: string = "<h1>Hello World</h1>"

  return (
    <div>
    {isVisible &&
        <SamModal
          htmlContent={html}
          hideCb={ hideCb }
          widthPct={40}
          heightPct={40} />
    }
    </div>
  );
}