react-mailchimp-subscribe icon indicating copy to clipboard operation
react-mailchimp-subscribe copied to clipboard

How do I style the form component

Open tobitech opened this issue 4 years ago • 1 comments

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.

tobitech avatar May 30 '20 02:05 tobitech

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 .... <FormStyle> <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 !} </FormStyle> ....

const FormStyle= styled.div` some style

input{ some style }

`

webdiego avatar May 11 '21 03:05 webdiego