Select one or more tags, then press “Search Plugins”

Find Plugin with any / all of the selected criteria
Search Plugin

Floating Labels For CF7 Wordpress Plugin - Rating, Reviews, Demo & Download

Floating Labels For CF7 Preview Wordpress Plugin - Rating, Reviews, Demo & Download
No ratings yet
Free
Follow for free plugins, new theme releases and theme news

Plugin Description

A floating label sits inside the empty field like a placeholder and moves to the top edge, smaller, as soon as the field is focused or filled. The label stays visible the whole time and is a real <label for> linked to the field, so screen readers and the browser’s autofill know what the field is for.

Floating Labels for CF7 rebuilds the markup Contact Form 7 renders on the server and ships the stylesheet for it. Nothing in your forms has to change: the plugin recognises the default Contact Form 7 template (<label> Your name [text* your-name] </label>) as well as fields with a placeholder option, and it leaves everything else exactly as Contact Form 7 renders it. Forms built with older Contact Form 7 versions, with loose text in front of the fields instead of labels or placeholders, get floating labels too once you switch on the option “Text before the field”.

Features

  • Works with existing forms: labels of the form template and placeholder options become floating labels automatically. Older templates with loose text in front of the fields (<p>Your Name<br />[text* your-name]</p>) are covered by the option “Text before the field”.
  • Three variants: Outlined (label floats onto the border), Filled (tinted box) and Minimal (your theme styles the field, the label floats above it).
  • Focus effects: a glow, a pulsing glow or a light running around the border of the focused field, in a colour of your choice. Pure CSS; visitors who prefer reduced motion see them without movement.
  • Pure CSS on the front end: focus, filled, autofill and error states come from CSS pseudo-classes. No JavaScript on your pages; the only inline styles are the design values you change (one short rule after the stylesheet, and a style attribute on forms with their own design values).
  • Accessible: every rebuilt field gets a real <label for> with a matching id; the placeholder is replaced so screen readers do not hear two names. Contact Form 7’s aria-* attributes stay untouched.
  • Clear error state: the label of an invalid field floats up in the error colour, Contact Form 7’s message appears inside the field (no layout jump), and the submit button turns red with a text of your choice until the next attempt.
  • Control at every level: for the whole site, per form (a tab in the form editor), per placement (page) and per field.
  • Block editor: the Contact Form 7 block, and a Shortcode block with the

    Error: Contact form not found.

    shortcode, get “Floating labels” panels in the sidebar: the placement settings, and colours, sizes, animation and focus effect for that placement only; no classes to type, and a reset button in every panel.
  • Design settings: colours with the WordPress colour picker, font size, padding, border, corner radius, the animation and the focus effect on the settings screen, or per placement in the block editor; every value is also a CSS custom property, so themes can set them too.
  • Sample page on request: a private page with forms that show every option, created and removed with one click on the settings screen.
  • Lightweight: one option, one stylesheet (on every page like the Contact Form 7 stylesheet, or only on pages with a form), no database tables, no cron, no external requests, no tracking.

Field types

Text, email, URL, telephone, number, date, textarea and select fields get floating labels. The label of a date field stays floated, because browsers show a format mask in the empty field. So does the label of a select, except while its blank option (include_blank or first_as_label) is selected: then the label rests in the field and the text of that option is hidden, so the label is the only hint. Checkboxes, radio buttons, selects with multiple choice, file uploads, quizzes and CAPTCHAs never get floating labels; they keep their original markup.

Per form

Open the tab “Floating labels” in the editor of a form and pick the values: on or off, the label source, the variant, the focus effect, the required marker and, optionally, a limit on the field types. They are saved as these lines in the form’s “Additional Settings” tab, which you can also write by hand:

jgor_floating_labels: off
jgor_floating_labels: placeholder
jgor_floating_labels: label
jgor_floating_labels: text
jgor_floating_labels_style: filled
jgor_floating_labels_effect: glow
jgor_floating_labels_marker: on
jgor_floating_labels_types: text email textarea

Per placement

The same form can look different on different pages. Select the Contact Form 7 block, or a Shortcode block with the

Error: Contact form not found.

shortcode, and open the panel “Floating labels” in the block sidebar: it offers on/off, the label source, the variant, the focus effect and the required marker for this placement. The choice is stored as classes in the block’s “Class” field (panel “Form attributes”) or in the html_class attribute of the shortcode, which you can also write by hand:

jgor-flcf7-off  jgor-flcf7-on
jgor-flcf7-mode-placeholder  jgor-flcf7-mode-label  jgor-flcf7-mode-text
jgor-flcf7-style-outlined  jgor-flcf7-style-filled  jgor-flcf7-style-minimal
jgor-flcf7-effect-none  jgor-flcf7-effect-glow  jgor-flcf7-effect-pulse  jgor-flcf7-effect-sweep
jgor-flcf7-marker-on  jgor-flcf7-marker-off

Example:

Error: Contact form not found.

The panels “Floating labels: colours”, “Floating labels: sizes”, “Floating labels: animation” and “Floating labels: focus effect” below it set colours, sizes, the animation and the look of the focus effect for this placement only. Leave a control empty to keep the value of the settings screen; the reset button at the end of each panel clears its values, and “Reset this placement” in the panel “Floating labels” clears the choices and all design values of this placement. The values are stored with the block, or in the jgor_flcf7_design attribute of the shortcode, which you can also write by hand (property names as on the settings screen, without the prefix):

Error: Contact form not found.

Per field

Add the option jgor_nofloat to a form-tag, before any quoted value:

[text* your-name jgor_nofloat placeholder "Your name"]

Colours and sizes

Open Contact > Floating Labels, section Design: colours for the label, the border, the field background and the submit button on errors (WordPress colour picker), the font size of the field and of the label, padding, border width, corner radius, the scale of the floated label, the duration of the animation, and the colour, size, width and duration of the focus effect. Leave a field empty to keep the default. Only the values you change are printed, as CSS custom properties on the .wpcf7 wrapper, right after the stylesheet. For one placement only, use the panels in the block editor (see “Per placement”); those values are printed as a style attribute on the wrapper of that form.

Themes can set the same properties in CSS, for example in Appearance > Customize > Additional CSS or a child theme:

.wpcf7 {
    --jgor-flcf7-label-size: 0.9em;
    --jgor-flcf7-border-color-active: #0a7d3e;
}

To style one form only, replace .wpcf7 with the id of its wrapper, for example [id^="wpcf7-f123-"]. The settings screen shows the full list of properties with the values in effect.

For developers

  • jgor_flcf7_settings: fix settings in code; the settings screen shows them disabled.
  • jgor_flcf7_form_settings: change the effective settings per rendering (mode, types, variant, focus effect, required marker).
  • jgor_flcf7_enabled: switch floating labels on or off per form.
  • jgor_flcf7_label_text: change the label text per field.
  • jgor_flcf7_field_types: extend the list of selectable field types.

Requirements and privacy

The plugin needs Contact Form 7 (5.0 or newer) and the PHP extension DOM, which is part of every standard PHP build. It stores one option in the WordPress database (a second one while the sample page exists), sends no data anywhere and loads nothing from third-party servers.

Contact Form 7 is a trademark of Rock Lobster, Inc. This plugin is an independent add-on and is not affiliated with or endorsed by Rock Lobster, Inc.

Screenshots

  1. Outlined variant: labels at rest and floated, with a focused field.

    Outlined variant: labels at rest and floated, with a focused field.

  2. Filled variant.

    Filled variant.

  3. Minimal variant with the theme's own field styling.

    Minimal variant with the theme’s own field styling.

  4. Validation error: label and border in the error colour, the message inside the field, the submit button in the error colour.

    Validation error: label and border in the error colour, the message inside the field, the submit button in the error colour.

  5. Settings screen under Contact > Floating Labels.

    Settings screen under Contact > Floating Labels.

  6. The panels "Floating labels" in the sidebar of the Contact Form 7 block (also shown for a Shortcode block with the shortcode).

    The panels “Floating labels” in the sidebar of the Contact Form 7 block (also shown for a Shortcode block with the shortcode).

  7. The tab "Floating labels" in the Contact Form 7 form editor: choices for this form, saved as lines in its Additional Settings.

    The tab “Floating labels” in the Contact Form 7 form editor: choices for this form, saved as lines in its Additional Settings.


Reviews & Comments