npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-typeform-embed

v1.0.8

Published

A React wrapper for [Typeform Embed SDK](https://developer.typeform.com/embed/).

Downloads

31,444

Readme

React Typeform Embed

A React wrapper for Typeform Embed SDK.

See a live demo.

Upgrading from v.0.3

Important: Please be aware that if you are updating this package from a version previous to v.1.0 you will need to apply changes in your implementation.

Usage

First install the package

yarn add react-typeform-embed

There are five different embed types that you can import as components.

  • Widget
  • Popup
  • Slider
  • Sidetab
  • Popover

Widget

With the widget embed type you can embed your form inline, in a DOM element.

import { Widget } from 'react-typeform-embed';

const App = () => {
  render() {
    return <Widget id="njdbt5" height={500} />;
  }
}

Popup and Slider

With the popup and slider embed types you can embed the form in a modal. You need to pass as children the element/s that will open the modal when clicked.

import { Popup /* or Slider */ } from 'react-typeform-embed';

const App = () => {
  return (
    <Popup id="njdbt5" size={80}>
      <button>Open Popup</button>
    </Popup>
  );
}

Sidetab and Popover

These other modal embed types work exactly as the Popup component but, since they are already visible and clickable, passing children element/s is optional.

import { Sidetab /* or Popover */ } from 'react-typeform-embed';

const App = () => {
  return <Sidetab id="njdbt5">
}

See the source for more examples.

Configuration

You need to provide the form id as id prop.

You can get the id from the public URL of your form URL (https://form.typeform.com/to/<form-id>) or admin panel URL (https://admin.typeform.com/form/<form-id>).

You can also use any other option and callback from the official SDK passing them as props. Find more info here:

<Widget
  id="your-form-id"
  height={400}
  opacity={80}
  hidden={{
    userId: 'hidden-user-id'
  }}
  onSubmit={() => {
    console.log('Form submitted!')
  }}
  hideHeaders
  disableAutoFocus
  enableSandbox
/>

Demo

See a live demo, or run:

git clone https://github.com/alexgarces/react-typeform-embed
cd react-typeform-embed
yarn
yarn start
open http://localhost:3000

Alternatives

License

Code released under the MIT license.