Add Icons to JetFormBuilder Fields: Font Awesome, SVG, Password Eye

To add a show/hide password eye in JetFormBuilder, you need no code. Set a Text Field's Field Type to password and turn on Show eye icon in the block's right-hand settings panel. This has been built in since JetFormBuilder 3.3.4. For icons inside other fields, such as a user icon in a username field or an envelope in an email field, one CSS block does the job. It targets each field by its Field Name and draws an SVG icon inside the input. It needs no icon font and no JavaScript.
Below you'll find the no-code password eye, the CSS snippet for field icons, and how to use Font Awesome icons if you already load them on your site.
- Before you start: update JetFormBuilder
- Add the show/hide password eye (no code)
- When icons help, and when they don't
- Add icons to text, email and password fields with CSS
- Using Font Awesome icons instead
- Troubleshooting
Before you start: update JetFormBuilder
Update to the latest JetFormBuilder before you customize anything. At the time of writing, that is version 3.6.7 on the WordPress.org plugin page. There are two reasons:
- Versions before 3.3.4 have no password eye option. On an older version, the setting described below won't appear.
- Security. Versions 3.6.5.x through 3.6.6.1 fixed serious issues. These include an unauthenticated blind SQL injection, unauthenticated deletion of Media Library attachments, and a reflected DOM XSS through HTML macros. Login and registration forms are public, so don't run them on an old version.
The current version requires WordPress 6.1 or higher and PHP 7.0 or higher. The full changelog is in the JetFormBuilder GitHub repository.
Add the show/hide password eye (no code)
JetFormBuilder added an eye icon for password fields in version 3.3.4. Version 3.4.1 fixed the eye's position on right-to-left (RTL) sites.
- Open your form in the JetFormBuilder editor.
- Add a Text Field block. From version 3.6.4 you can also insert the ready-made Password variation of the Text Field, which saves a step. That release also added Email, URL, First Name and Last Name variations.
- Select the field. In the right-hand settings panel, set Field Type to password.
- Turn on the Show eye icon toggle that appears below it.
- Give the field a clear label and a Field Name, for example
user_password, and save the form.
What you should see: on the front end, the password field shows an eye icon. Clicking it reveals the typed password, and clicking it again hides it.
Don't add your own JavaScript toggle on top of this. Many older tutorials flip type="password" to type="text" with a custom script. Doing that on top of the built-in eye gives you two eyes that can fight each other. If you're building a full login form, Crocoblock's guide to WordPress login form customization with JetFormBuilder covers the rest of the setup.
When icons help, and when they don't
- Quick visual cue: a user icon or an envelope tells people what goes in the field at a glance, especially on short login forms.
- Fewer password mistakes: the eye lets people check what they typed before they submit.
- A cleaner look: icons make compact forms look finished.
An icon is not a label. Keep a visible label on every field and treat icons as decoration. Screen readers and many users rely on the label, and an icon on its own doesn't tell them what the field is for. The CSS method below draws icons as background images, so assistive technology ignores them, which is what you want.
Add icons to text, email and password fields with CSS
CSS can't place a pseudo-element such as ::before inside an <input> element, because inputs don't render generated content. The reliable workaround is to paint the icon as a background image on the input itself and add padding so the text doesn't overlap it. This works with any theme. You don't need to know JetFormBuilder's wrapper class names, because the selector uses the input's name attribute, which comes from the Field Name you set in the block.
Step 1: Set clear Field Names
Select each field in the form editor and note its Field Name in the settings panel. The snippet below uses user_login, user_email and user_password. Rename the selectors to match your fields.
Step 2: Confirm the name on the front end
Open the page with the form, right-click the input and choose Inspect. Check that the <input> element has name="user_email", or whatever your Field Name is. If the name differs, use the value you see in the inspector.
Step 3: Add the CSS
Paste the CSS into Appearance > Customize > Additional CSS (on block themes: Appearance > Editor > Styles > Additional CSS), or into your child theme's style.css. Don't edit the parent theme's files, because a theme update overwrites them. Here is the snippet:
Code
/* JetFormBuilder field icons: inline SVG, no icon font needed.
Replace user_login, user_email and user_password with your own Field Names. */
input[name="user_login"],
input[name="user_email"],
input[name="user_password"] {
padding-inline-start: 42px; /* room for the icon; flips automatically on RTL sites */
background-repeat: no-repeat;
background-position: left 14px center;
background-size: 18px 18px;
}
/* Right-to-left sites: move the icon to the other side */
[dir="rtl"] input[name="user_login"],
[dir="rtl"] input[name="user_email"],
[dir="rtl"] input[name="user_password"] {
background-position: right 14px center;
}
/* User icon */
input[name="user_login"] {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E");
}
/* Envelope icon */
input[name="user_email"] {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
}
/* Lock icon: sits at the start of the field, away from the built-in eye toggle */
input[name="user_password"] {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}How the CSS works
- The selectors match inputs by their
nameattribute, so only the fields you list get an icon. Other forms on the page are not affected unless they use the same field names. - The icons are small SVGs embedded as data URIs. In them,
%3Cand%3Estand for<and>, and%23stands for#. The browser loads nothing extra. padding-inline-startpushes the typed text and the placeholder past the icon. It adds padding on the left in left-to-right languages and on the right in RTL languages.- The RTL rule moves the background image to the right side when the page has
dir="rtl", which WordPress sets for RTL languages. - The password field keeps its icon at the start of the input, so it stays clear of JetFormBuilder's built-in eye.
Test it
- Reload the form page with a hard refresh, and clear any page cache or CSS optimization plugin cache.
- Check that each field shows its icon and that typed text starts after it.
- Type a password and click the eye. It should still toggle, with only one eye visible.
- If your site has an RTL language, switch to it and confirm the icon moves to the right.
Customize the icons
- Color: change
%236b7280in eachstrokeattribute to another hex color, keeping%23in place of#. For example, use%230d9488for teal. - Size: change
background-sizeand increasepadding-inline-startto match. - Other icons: replace the SVG markup inside
url("…")with any SVG icon. Encode<,>and#as shown above, use single quotes inside the SVG, and check the icon's license before you use it. - More fields: copy a block, change the
namevalue and add the new selector to the first two rule groups.
Using Font Awesome icons instead
If your site already uses Font Awesome, you can show its icons next to fields instead of SVG backgrounds. Keep two things in mind:
- Font Awesome must be loaded on the form page, for example through the official Font Awesome plugin or a Kit. JetFormBuilder doesn't load it for you. Font Awesome's class names and font names change between major versions, so copy the icon markup from the version you actually load.
- An input can't hold an icon font glyph, but its wrapper can. JetFormBuilder wraps every Text Field input in a
divwith the classjet-form-builder__field-wrap, so you can draw the glyph on that wrapper's::before.
Copy the Unicode value and font family from the Font Awesome version you load. This example uses Font Awesome 6 Free. If you also use the SVG snippet above, delete its rule for the same field so it doesn't show two icons:
.jet-form-builder__field-wrap:has(> input[name="user_email"]) {
position: relative;
}
.jet-form-builder__field-wrap:has(> input[name="user_email"])::before {
content: "\f0e0"; /* envelope; user is \f007, lock is \f023 */
font-family: "Font Awesome 6 Free";
font-weight: 900;
position: absolute;
inset-inline-start: 14px;
top: 50%;
transform: translateY(-50%);
color: #6b7280;
pointer-events: none;
}
.jet-form-builder__field-wrap > input[name="user_email"] {
padding-inline-start: 42px;
}This works with Font Awesome's web font (CSS) version. The SVG + JavaScript version only draws icons in ::before when its pseudo-elements option is turned on. If you would rather output an <i> element, the PHP actions jet-form-builder/before-field and jet-form-builder/after-field (since 3.3.4) run inside that wrapper and pass one argument, the field's render object.
For most login and registration forms, the SVG method above is simpler. It has no extra font request, no version clashes and no PHP. If you do add PHP for the hooks, put it in a child theme's functions.php or a small custom plugin, never in the parent theme's functions.php, where it is lost on the next theme update.
Troubleshooting
- No icon appears. The Field Name in your CSS doesn't match the input's
nameattribute, or a cache is serving old CSS. Inspect the input, fix the selector and clear all caches. - The icon appears, then disappears. Your theme may set the
backgroundshorthand on inputs with a more specific selector, which wipes out the image. Make your selector more specific, for example by adding a class from your page wrapper. Use!importantonbackground-imageonly as a last resort. - Text or placeholder overlaps the icon. The theme's padding wins over yours. Increase
padding-inline-startor make the selector more specific. - Two eye icons on the password field. A custom JavaScript toggle, or another plugin, is running alongside JetFormBuilder's built-in eye. Remove the custom one.
- No eye option in the panel. Your JetFormBuilder is older than 3.3.4, or Field Type isn't set to password. Update the plugin and check Field Type.
- Font Awesome shows empty squares or nothing. Font Awesome isn't loading on that page, or two different versions are loaded at once. This often happens when a theme, a page builder and a plugin each load their own copy. Load a single copy and use class names from that version.
- Icon on the wrong side in RTL. Make sure the RTL rule from the snippet is included and that the page's
<html>tag hasdir="rtl".
For more JetFormBuilder field polish, see how to add a phone field with a country flag and auto-detect and how to style JetFormBuilder file upload fields.
That's the whole setup: the built-in eye for passwords and one CSS block for field icons, with no extra scripts. If you'd rather have someone build or style your JetFormBuilder login or registration form for you, post a request on BoostMyCroco.
Frequently Asked Questions
Does JetFormBuilder have a built-in show password option?
Can I add icons to JetFormBuilder fields without Font Awesome?
Why are my JetFormBuilder field icons not showing?
Where should I put custom code for JetFormBuilder?
Why does my password field show two eye icons?
Sources
- JetFormBuilder — Dynamic Blocks Form Builder (wordpress.org)
- GitHub - Crocoblock/jetformbuilder · GitHub (github.com)
- WordPress Login Form Customization with JetFormBuilder (jetformbuilder.com)
- Font Awesome (wordpress.org)
- Upgrade to v7 with WordPress (docs.fontawesome.com)
- Set Up with WordPress (docs.fontawesome.com)
- Croco Educates April Issue: What's New? (2026) (crocoblock.com)
- Croco Educates June Issue 2026 - Crocoblock (crocoblock.com)


