Skip to the content

Newsletter inline

The one-line newsletter sign-up of a hero or a footer: an email field and its button in one shape.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    The look of the preview is the newsletter-inline-* classes of the paste: the shape, the field and the button, large and compact. Restyle them in the Style panel: the line of confirmation takes the background and the colour of your button by itself. The Embed holds what moves, and three colours as variables at the top of its styles, --newsletter-inline-accent, --newsletter-inline-ink and --newsletter-inline-error. The send button is a Link block, because a Webflow submit button is an input and cannot hold the layers that move; the script makes it send the form, and Enter in the field does too.
  3. Add custom JS

  4. Use it on your own elements

    Custom attributes
    Select the element on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-newsletter-inline Marks the form. It takes no value: leave the value field empty. In the paste it is on the Form inside each Form block. The settings below go on the same element.
    data-newsletter-inline-line On the shape: the box that holds the email field and the send button side by side. It takes no value. The engine draws the light and the line of confirmation in it. Without it the parent of the field is taken. [ Optional ]
    data-newsletter-inline-submit On the send button: a submit button in plain HTML, a Link block in Webflow, which has no button that can hold layers. It takes no value. Without it the form is not mounted. [ Required ]
    data-newsletter-inline-hint On the line under the shape: a consent, a promise. It takes no value. The reason takes its place while the address is wrong, then the hint comes back. A form without one gets a line from the engine. [ Optional ]
    data-newsletter-inline-hide On the label of the field, when it is not shown: it stays in the page for a screen reader. It takes no value. The compact line of the paste has it. [ Optional ]
    data-newsletter-inline-trap Optional, on one more text field no visitor sees or reaches: a robot that fills it is shown the confirmation and nothing is sent. It takes no value. Not needed in a Webflow Form block, which has its own protection. [ Optional ]
    data-newsletter-inline-consent Optional, on a checkbox of the form: the address only leaves once it is ticked, and the words of the setting tick show under the shape until then. It takes no value. [ Optional ]
    data-newsletter-inline-state Written by the engine on the form, several words at once: focus, filled, error, then loading, done or failed. Never written by hand; the stylesheet reads them, and so can a rule of yours. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same element. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-newsletter-inline-send auto How the address leaves once it is right. Options: auto lets a Webflow Form block send it to Webflow, and anywhere else posts the form to its action the usual way, the page changing; fetch posts it without leaving the page and reads the status of the answer.
    data-newsletter-inline-endpoint empty The address fetch posts to, the one a newsletter service gives. Empty, fetch posts to the action of the form. Options: a full address, https://app.loops.so/api/newsletter-form/...; only read when send is fetch.
    data-newsletter-inline-sending Sending The word on the button while the address is on its way. Options: any text, in the language of the page.
    data-newsletter-inline-sent You are in. Check your inbox. The line of confirmation the field and the button become. In a Webflow Form block the words of the Success message are used instead, unless this attribute is written on the form. Options: any text; keep it to one short sentence, it is set on one line, two on a phone.
    data-newsletter-inline-failed Try again The word on the button when the send failed; the button can be pressed again. Options: any text.
    data-newsletter-inline-refused That did not go through. The reason under the shape when the send failed. In a Webflow Form block the words of the Error message are used instead, unless this attribute is written on the form. Options: any text.
    data-newsletter-inline-required Enter your email address. The reason under the shape when it is sent empty. Options: any text.
    data-newsletter-inline-email This address is not complete. The reason under the shape when what was typed is not an address. Options: any text.
    data-newsletter-inline-tick Tick the box to subscribe. The reason under the shape when the form has a consent box and it is not ticked. Options: any text.
    data-newsletter-inline-merge 1100 How long the field and the button take to become one line, in milliseconds: the travel of the button, then the rise of the line of confirmation.
    The way the address is sent
    Nothing to connect: each line of the paste is a native Webflow Form block, and Webflow receives what it sends. The entries are listed in Site settings, Forms, and the address told of a new entry is set in the same place. Entries only arrive from a published site, its webflow.io address included: the Designer and its preview send nothing. The words of the line of confirmation are those of Webflow's Success message, and the reason of a failed send those of its Error message: select the Form block, open its settings, choose the state and rewrite the words on the canvas. On the published page those two blocks stay out of sight and the form stays in place to become the line. Leave the Action of the form empty, or Webflow receives nothing. To send the address to a newsletter service instead, the attributes below apply, on a form that is not a Webflow Form block.
    Custom attributeWhat it does
    data-newsletter-inline-send="fetch" On the form: posts the values without leaving the page, encoded as a plain form does, with the header Accept: application/json. An answer in the 200s plays the line of confirmation, anything else shows Try again and the reason. It is the setting send, so it may also be set for the whole site.
    data-newsletter-inline-endpoint="https://..." On the form: where fetch posts, the address a newsletter service gives, https://app.loops.so/api/newsletter-form/YOUR_FORM_ID for Loops. Empty, fetch posts to the action. The service has to accept requests from the page's origin.
    action="https://..." On the form: the address the form is posted to the usual way, the one Mailchimp or Buttondown gives. Not a custom attribute in Webflow, where it is the Action field of the Form settings, to leave empty for Webflow to receive the entries.
    name="email" On the field: the name the service files the address under. email for Loops, MERGE0 for Mailchimp; for any other service, the name its own form uses. In Webflow it is the Name of the field, in its settings.

What it does

Newsletter inline is an animated form for Webflow and vanilla JavaScript, with no library. Also called newsletter form, newsletter sign up form or email signup form.

The one-line newsletter sign-up of a hero or a footer: an email field and its button in one shape. While the address is on its way the word of the button gives its place to Sending and a light runs round the whole shape, field and button as one. Once it is sent the edge of the button travels over the address, which does not move, until the button is the whole shape; the gap round it closes as it arrives, the line of confirmation rises where the address stood and a tick is drawn where the word of the button was. A wrong address is said under the shape, in place of the hint, and the reason leaves at the keystroke that fixes it, so nothing below ever moves. It is a real form: pasted in Webflow it is a native Form block whose entries land in the site's Forms tab; elsewhere it posts to its action, or with fetch to the endpoint of a newsletter service, or hands the address to the page. A label for screen readers, shown or not, the state read out, a trap for robots and a consent box as options, reduced motion respected, the same one shape down to the width of a phone. No library. Pattern type newsletter signup form, email subscribe input.

Updated

Questions

Paste it: each line arrives as a native Webflow Form block whose Form carries data-newsletter-inline, with the email field and a Link block marked data-newsletter-inline-submit side by side in a box marked data-newsletter-inline-line. Webflow receives the addresses, listed in Site settings, Forms, once the site is published.

Yes. For a service that answers a request from a web page, Loops for one, add data-newsletter-inline-send="fetch" and its address in data-newsletter-inline-endpoint. Mailchimp and Buttondown are posted the usual way, to the action each one gives, with the field named as it asks (MERGE0 for Mailchimp).

In Webflow, rewrite the Success message of the Form block: its words are the line of confirmation the field and the button become. Elsewhere the sentence is the setting sent, written as data-newsletter-inline-sent on the form.

Add one more text field marked data-newsletter-inline-trap. Visitors never see or reach it; when it comes back filled, the form shows its confirmation and sends nothing. A consent checkbox marked data-newsletter-inline-consent can also be required before the address leaves.

It keeps a real label: shown above the line, or marked data-newsletter-inline-hide, which leaves it to screen readers. A wrong address is announced from the line under the field, the confirmation is a status region, Enter sends from the field, and reduced motion shows every state at once.