https://github.com/halo-lab/solid-form-getform-io
https://github.com/halo-lab/solid-form-getform-io
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/halo-lab/solid-form-getform-io
- Owner: Halo-Lab
- License: isc
- Created: 2023-03-13T09:46:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-31T11:26:09.000Z (over 3 years ago)
- Last Synced: 2025-03-11T03:03:28.809Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 466 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @halo-lab/solid-form-getform-io
This is a form component built with Solid.js that allows you to easily create a form that submits data to a GetForm endpoint. The form has three fields: name (input type="text"), email (input type="email"), and message (textarea). You can choose which fields to display by passing props to the component.
## Installation
You can install the package using npm:
`npm install @halo-lab/solid-form-getform-io`
## Usage
To use the form component, you need to import it into your Solid.js application:
`import Form from '@halo-lab/solid-form-getform-io';`
You can then use the component in your application:
```js
```
You need to provide your GetFormID as the getFormID prop.
By default, all three fields (name, email, and message) will be displayed in the form. If you want to display only specific fields, you can use the showName, showEmail, and showMessage props:
## Props
The following props are available for the form component:
- getFormID (required): Your GetFormID.
- showName (optional, default true): Whether to show the name field.
- showEmail (optional, default true): Whether to show the email field.
- showMessage (optional, default true): Whether to show the message field.
- onFormSubmit(optional, default null): Function that is executed when the form is submitted
## Example
Here's an example of how to use the form component:
```js
import Form from '@halo-lab/solid-form-getform-io';
const App = () => {
function onFormSubmit() {
console.log("Form submitted!");
}
return (
);
}
```
## Word from the author
Have fun ✌️