Code Monkey home page Code Monkey logo

typeform-elements's Introduction

IMPORTANT NOTE

โš ๏ธ This library hasn't been maintained for a while so we've decided to deprecate it and archive the repository. Please use embed instead.


typeform-elements

npm version

Custom elements for easy use of Typeform

Table of Contents

Downloading Typeform Elements

You can install Typeform Elements via npm:

npm install typeform-elements

Or you can use Typeform Elements via CDN:

<script src="https://unpkg.com/typeform-elements/dist/typeform-elements.js"></script>

If you do use this library from NPM be sure to import it somewhere in your JS code:

import 'typeform-elements';

// or

import { /* Whatever component(s) you want */ } from 'typeform-elements';

Elements

Login

Add the button code to your application and configure it to work with the link that redirects users to the Typeform login screen (https://api.typeform.com/oauth/authorize) so they can log in to their Typeform accounts and grant access to your app via OAuth 2.0 scopes.

CDN

You can use the login element via CDN without needing to import all of the Typeform Elements.

<script src="https://unpkg.com/typeform-elements/dist/login.js"></script>

Usage

<typeform-login client-id="{your_client_id}" scope="{comma_separated_scopes}" redirect-uri="{your_redirect_uri}" state="{optional_state}"></typeform-login>

Example

<typeform-login client-id="1234567890" scope="accounts:read,forms:read" redirect-uri="https://results-example.herokuapp.com/callback"></typeform-login>

TypeformLogin (<typeform-login>) Attributes

Attribute Required Description Type Default
client-id true The id of the application that asks for authorization. String null
redirect-uri true A successful response from results in a redirect to this URL. String null
scope true List of permissions that the application requires. Ensure list is in comma separated format, like so: accounts:read,forms:read String null
state false An opaque value, used for security purposes. If this request parameter is set in the request, then it is returned to the application as part of the redirect_uri. String null

Embed

Easily display forms as elements on your page as a standard embeded form, a full page embeded form, and a pop up form.

CDN

You can use the login element via CDN without needing to import all of the Typeform Elements.

<script src="https://unpkg.com/typeform-elements/dist/embed.js"></script>

Usage

<typeform-widget url="{typeform_url}"></typeform-widget>

<typeform-popup formId="{typeform_form_id}"></typeform-popup>

Example

<typeform-widget url="https://admin.typeform.com/to/PlBzgL"></typeform-widget>

<typeform-popup formId="PlBzgL"></typeform-popup>

Attributes

Attribute Required Description Type Default
url false URL of Typeform, if no URL provided formId must be provided. String null
formId false Form ID of Typeform, if no form ID provided url must be provided. String null

All elements have the following attributes: autoClose, buttonText, chat, height, hideFooter, hideHeaders, opacity, width.

All elements emit the following events: submit.

Please read more about them here.

Contributing

All code should pass tests, as well as be well documented. Please open PRs into the dev branch. Please also see the Commit Message Guidelines for how commit messages should be structured.

typeform-elements's People

Contributors

chancesmith avatar gierlas avatar mathio avatar michaelsolati avatar mumpo avatar picsoung avatar seti-tf avatar tf-security avatar thr44 avatar vrybas avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

chancesmith

typeform-elements's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.