1.5.5 • Published 3 years ago

convertkit-react v1.5.5

Weekly downloads
117
License
MIT
Repository
github
Last release
3 years ago

Using Vue? Try ConvertKit-Vue

Setup

yarn add convertkit-react

Demos

View examples on how to use different templates here and how to style your form with custom styling here

Usage

import ConvertKitForm from 'convertkit-react'

const MY_FORM_ID = 1234567

function HomePage() {
  return (
    <ConvertKitForm formId={MY_FORM_ID} />
  )
}

To get your form id, go to the form you have created on convertkit and choose the HTML embed option.

form embed screenshot

Here you'll pick out your form id from the form action in the embed code:

<form
  action="https://app.convertkit.com/forms/YOUR_FORM_ID_IS_HERE/subscriptions"
></form>

Passing custom configuration options

function HomePage() {
  const config = {
    formId: MY_FORM_ID,
    template: 'mills',
    emailPlaceholder: 'Enter an email address',
    submitText: 'Sign up',
  }

  return (
    <ConvertKitForm {...config} />
  )
}

Configuration Options

PropertyTypeDefaultDescription
formatStringinlineinline, modal, slidein, sticky
templateStringminimalTemplates in the app + minimal
submitTextStringSubscribeText shown in submit button
headingTextStringVaries per templateText shown in heading
disclaimerTextStringVaries per templateText shown in disclaimer area
emailPlaceholderStringYour emailPlaceholder for email input
namePlaceholderStringYour first namePlaceholder for first name input
nameLabelStringFirst nameCustom name label
emailLabelStringEmailCustom email label
showLabelsBooleanfalseShows labels with form inputs or only rely on aria-label
hideNameBooleanfalseHides the name input field
newTabBooleanfalseDetermines if form should be processed in new tab or current
stackBooleantrueDetermines if inputs are stacked or placed inline
hideWarningsBooleanfalseHide warnings that are shown due to misconfiguration
backgroundImageStringdefault on templateUse a different background image for your form
backgroundOpacityNumber0.8Opacity here is the inverse of what is on the app which really measures transparency
buttonBackgroundStringVaries per templateA valid CSS color string
buttonColorStringVaries per templateA valid CSS color string
Templates

The minimal template has no preconfigured styling, leaving you options to style as desired. To get a preconfigured style, use one of the app templates (clare, mills, rainier, powell etc) as seen on the app.

Content

To change the subheader (sometimes referred to as content) you may just add children inside the <ConvertkitForm> component like below:

<ConvertKitForm {...config}>
  <p>Subscribe to get our latest content by email.</p>
</ConvertKitForm>

Contributing

To publish a package:

./publish X.X.X "Message about version"

where X.X.X is the version number.

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.5-beta.0

3 years ago

1.5.0

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago