tc-form-embed
v1.0.4
Published
**Tiny Command Forms Embed** is an NPM package that allows developers to easily integrate forms created with Tiny Command Forms into their React applications. With just a few lines of code, you can embed a form on your site using a sharable URL.
Downloads
21
Readme
Tiny Command Forms Embed
Tiny Command Forms Embed is an NPM package that allows developers to easily integrate forms created with Tiny Command Forms into their React applications. With just a few lines of code, you can embed a form on your site using a sharable URL.
Installation
You can install the package via NPM:
npm install tinycommand-forms-embed
Usage
To use the TinyCommandFormEmbed
component, import it into your React application and provide the required formUrl
prop.
Example
import React from "react";
import TinyCommandFormEmbed from "tinycommand-forms-embed";
const App = () => {
return (
<div>
<h1>My Form</h1>
<TinyCommandFormEmbed
formUrl="https://example.com/myform" // Replace with your actual form URL
onSubmit={(answers) => {
console.log(answers);
}}
/>
</div>
);
};
export default App;
Props
| Prop | Type | Required | Description |
| ---------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| formUrl
| string | Yes | The URL of the form to embed. |
| onSubmit
| function | No | A callback function that is called when the form is submitted. It receives the submission data as an argument. |