Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I style the form component #46

Open
tobitech opened this issue May 30, 2020 · 1 comment
Open

How do I style the form component #46

tobitech opened this issue May 30, 2020 · 1 comment

Comments

@tobitech
Copy link

Please help. I've tried all I could to style the MailChimpSubscribe component but nothing is working.
I've used className to add a css class
<MailChimpSubscribe className="footer-form" />

I've also used style attribute
<MailChimpSubscribe style={{ color: "red" }} />

none of these seem to be working.

@webdiego
Copy link

webdiego commented May 11, 2021

const CustomForm = () => (
<MailchimpSubscribe
url={url}
render={({ subscribe, status, message }) => (

Use this div as reference, and add your style

  <div>
    <SimpleForm onSubmitted={formData => subscribe(formData)} />
    {status === "sending" && <div style={{ color: "blue" }}>sending...</div>}
    {status === "error" && <div style={{ color: "red" }} dangerouslySetInnerHTML={{__html: message}}/>}
    {status === "success" && <div style={{ color: "green" }}>Subscribed !</div>}
  </div>
)}

/>

Example

div+input {
some style
}

If you are using styled components
....

<SimpleForm onSubmitted={formData => subscribe(formData)} />
{status === "sending" && <div style={{ color: "blue" }}>sending...}
{status === "error" && <div style={{ color: "red" }} dangerouslySetInnerHTML={{__html: message}}/>}
{status === "success" && <div style={{ color: "green" }}>Subscribed !}

....

const FormStyle= styled.div`
some style

input{
some style
}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants