utrigg-form-embed-react

This package is created to simplify the process of uTrigg form embedding within SPA application

Usage no npm install needed!

<script type="module">
  import utriggFormEmbedReact from 'https://cdn.skypack.dev/utrigg-form-embed-react';
</script>

README

This package is created to simplify the process of uTrigg form embedding within SPA application

Guide

  1. Install package via command npm install utrigg-form-embed-react
  2. Import package into needed component with command import UtriggFormEmbedReact from 'utrigg-form-embed-react'
  3. Place imported package into the template
  4. Provide prop code with embedding code from uTrigg platform if you are using "Full" version.
  5. Provide prop short-code with embedding code from uTrigg platform and prop alias with form alias from uTrigg platform if you are using "Short" version.
  6. For an accurate 'Own button style' option handling watch examples below

Basic Example for Full code embedding:

   import UtriggFormEmbedReact from 'utrigg-form-embed-react'
   const YourComponent = () => {
    ...
    const codeFromUtrigg = `*here goes code from uTrigg platform*`
    return (<UtriggFormEmbedReact code={codeFromUtrigg}/>)
    ...
   }

Example for Full code embedding with 'Own button style' option:

    ...
    const codeFromUtrigg = `*here goes code from uTrigg platform*`
    const alias = `*Alias from utrigg platform*`
    return (
        <UtriggFormEmbedReact code={codeFromUtrigg} alias='alias'>
            <button>Your own button</button>
        </UtriggFormEmbedReact>
    )
    ...

Example for Short code embedding:

    ...
    const codeFromUtrigg = `*here goes code from uTrigg platform*`
    const alias = `*Alias from utrigg platform*`
    return (
        <UtriggFormEmbedReact code={codeFromUtrigg} alias='alias' />
    )
    ...