Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed Calendly into React

Calendly provides this embed code that gets added to the page and displays calendar options to choose from.

<div class="calendly-inline-widget" data-url="https://calendly.com/username" style="min-width:320px;height:580px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>

I can't figure out the way to embed this code into the component. What's the best way to do so here?

import React, { Component} from "react";

class Calendly extends Component {
  ComponentDidMount( )

  render(){
    return (
      <div>
        <div id="schedule_form">

        </div>
      </div>
    );
  }
};

export default Calendly;
like image 991
Max T Avatar asked Dec 21 '18 23:12

Max T


People also ask

Can you embed Calendly?

You can add your Calendly booking flow directly to your website, so your site visitors can schedule with you without leaving your site. You can choose from three customizable embed options.

Does Calendly have an API?

We currently provide three APIs for you to integrate Calendly into your application: API v2: Our current, actively maintained API. The Calendly API v2 is REST-based and has predictable resource-oriented URLs.


1 Answers

You can use this package react-calendly and just pass in the calendly url

import { InlineWidget } from 'react-calendly';

const App = () => {
return <InlineWidget url="yourcalendlyurl"/>
}

export default App

and you're good to go.

like image 169
Albert Dugba Avatar answered Oct 26 '22 02:10

Albert Dugba