cf-component-form
Cloudflare Form Component
Installation
Installation with yarn is recommended
$ yarn add cf-component-form
Usage
import React from 'react';import Form FormHeader FormFooter FormFieldset FormLabel FormFieldError from 'cf-component-form';import Input from 'cf-component-input';import Select from 'cf-component-select';import Textarea from 'cf-component-textarea';import Button from 'cf-component-button'; Component { ; thisstate = firstName: '' lastName: '' type: 'suggestion' message: 'This is blasphemy! This is madness!' ; thishandleFirstNameChange = thishandleFirstNameChange; thishandleLastNameChange = thishandleLastNameChange; thishandleTypeChange = thishandleTypeChange; thishandleMessageChange = thishandleMessageChange; thishandleSubmit = thishandleSubmit; } { this; } { this; } { this; } { this; } { console; this; } { return <Form ="horizontal" => <FormHeader ="Feedback Form" /> <FormFieldset ="Name"> <FormLabel ="firstName">First Name</FormLabel> <Input ="firstName" ="firstName" ="text" = = /> <FormLabel ="lastName">Last Name</FormLabel> <Input ="lastName" ="lastName" ="text" = = /> </FormFieldset> <FormFieldset ="Type"> <FormLabel ="type" > Type </FormLabel> <Select ="type" = = = /> </FormFieldset> <FormFieldset ="Message"> <FormLabel ="message" > Message </FormLabel> <Textarea ="message" ="message" = = /> <FormFieldError = = /> </FormFieldset> <FormFooter> <Button ="primary" => Submit </Button> </FormFooter> </Form> ; } ;