|
/ Documentation /Spectra 3 Beta/ Login Block in Spectra

Login Block in Spectra

Introduction

The Login Form Block allows you to create customizable user login forms anywhere on your WordPress site. Perfect for member areas, custom login pages, or frontend authentication. The block provides extensive styling options and modular child components that you can arrange and customize to match your design needs.

How to Add or Use the Block

Adding the Block

  • Click the “+” button in the editor to open the block inserter
  • Search for “Login Form” or navigate to the Spectra Pro v2 category
  • Click on the Login Form Block to add it to your page
  • The block automatically creates a complete login form with all necessary fields

Working with Form Components

  • Click on any form element to select and customize it
  • The form includes these child blocks by default:
    • Welcome heading
    • Username/Email input field
    • Password input field with toggle visibility
    • Remember Me checkbox
    • Submit button
    • Forgot password and register links
    • Success and error message areas

Customizing Form Elements

  • Select individual child blocks to customize their specific settings
  • Use the parent Login Form block settings for global color and style controls
  • All child blocks inherit parent colors but can override locally

Block Architecture

The Login Form Block uses a parent-child relationship:

  • Login Form Block (Container): spectra-pro/login – Manages overall layout, colors, and form behavior
  • Child Blocks: Individual form components that inherit parent settings:
    • spectra-pro/form-input-wrapper – Input field containers
    • spectra-pro/form-input-label – Field labels
    • spectra-pro/form-icon – Input field icons
    • spectra-pro/form-input-field – Input fields
    • spectra-pro/form-checkbox – Remember Me checkbox
    • spectra-pro/form-button – Submit button
    • spectra-pro/form-link – Forgot password and register links
    • spectra-pro/form-message – Success/error messages
    • spectra-pro/form-recaptcha – reCAPTCHA component

Important: Child blocks inherit styling from the parent but can be customized individually.

General Settings

OptionDescriptionAvailable Settings
Show LabelsDisplay field labelsOn/Off toggle
Show IconsDisplay icons in input fieldsOn/Off toggle
Show Remember MeDisplay remember me checkboxOn/Off toggle
Show Forgot PasswordDisplay forgot password linkOn/Off toggle
Show Register LinkDisplay registration linkOn/Off toggle
Show Password ToggleAllow showing/hiding passwordOn/Off toggle
Overall AlignmentForm alignmentLeft, Center, Right
Button AlignmentSubmit button alignmentLeft, Center, Right
Form WidthMaximum width of form containerCustom width with units

Field Labels and Placeholders

OptionDescriptionDefault Value
Username LabelLabel for username field“Username or Email”
Username PlaceholderPlaceholder text“Enter your username or email”
Password LabelLabel for password field“Password”
Password PlaceholderPlaceholder text“Enter your password”
Remember Me LabelCheckbox label“Remember Me”
Submit Button TextButton text“Log In”
Forgot Password TextLink text“Forgot Password”
Forgot Password URLLink destinationURL field
Register Link TextLink text“Don’t have an account? Register”
Register Link URLLink destinationURL field

Color Settings

Label Colors
OptionDescriptionAvailable Settings
Label ColorDefault label text colorColor picker
Label Color HoverLabel text color on hoverColor picker
Input Field Colors
OptionDescriptionAvailable Settings
Input Text ColorText color inside input fieldsColor picker
Input Text Color HoverText color on hoverColor picker
Input BackgroundInput field backgroundColor picker
Input Background HoverBackground on hoverColor picker
Input Border ColorBorder colorColor picker
Input Border HoverBorder color on hoverColor picker
Input Border FocusBorder color when focusedColor picker
Placeholder ColorPlaceholder text colorColor picker
Icon Colors
OptionDescriptionAvailable Settings
Icon ColorColor for input field iconsColor picker
Fields Icon SizeSize of field iconsDefault: 16px
Eye Icon SizeSize of password toggle iconDefault: 16px
Eye Icon ColorPassword toggle icon colorColor picker
Button Colors
OptionDescriptionAvailable Settings
Button Text ColorSubmit button text colorColor picker
Button Text HoverText color on hoverColor picker
Button BackgroundButton background colorColor picker
Button Background HoverBackground on hoverColor picker
Button Border ColorBorder colorColor picker
Button Border HoverBorder color on hoverColor picker
Link Colors
OptionDescriptionAvailable Settings
Link ColorColor for forgot password and register linksColor picker
Link Color HoverLink color on hoverColor picker
Checkbox Colors
OptionDescriptionAvailable Settings
Checkbox BackgroundBackground of checkboxColor picker
Checkbox mark ColorCheckmark colorColor picker
Message Colors
OptionDescriptionAvailable Settings
Success BackgroundBackground for success messagesColor picker
Success Text ColorText color for success messagesColor picker
Success BorderBorder color for success messagesColor picker
Error BackgroundBackground for error messagesColor picker
Error Text ColorText color for error messagesColor picker
Error BorderBorder color for error messagesColor picker
Form Container Colors
OptionDescriptionAvailable Settings
Background ColorForm container backgroundColor picker
Background GradientContainer gradient backgroundGradient picker
Background HoverContainer background on hoverColor picker
Gradient HoverContainer gradient on hoverGradient picker
Layout and Spacing Settings
OptionDescriptionAvailable Settings
PaddingInternal spacingTop, Right, Bottom, Left (Responsive)
MarginExternal spacingTop, Right, Bottom, Left (Responsive)
Block GapSpace between form elementsCustom spacing (Responsive)
BorderForm container borderWidth, Style, Color, Radius
Box ShadowShadow effectsMultiple shadow layers

Advanced Features

Security Settings

OptionDescriptionAvailable Settings
Enable reCAPTCHAAdd spam protectionOn/Off toggle
reCAPTCHA VersionVersion to usev2, v3

Note: reCAPTCHA requires configuration in Spectra Pro settings with valid site and secret keys.

Redirect Settings

OptionDescriptionAvailable Settings
Redirect After LoginURL to redirect after successful loginURL field
Redirect After LogoutURL to redirect after logoutURL field
Enable Logged In MessageShow message if user is already logged inOn/Off toggle

Custom Messages

OptionDescriptionDefault Value
Success Message TextMessage shown on successful login“Login successful! Redirecting…”
Error Message TextMessage shown on failed login“Login failed. Please check your credentials.”

Demo Messages

OptionDescriptionAvailable Settings
Show Demo Success MessagePreview success message in editorOn/Off toggle
Show Demo Error MessagePreview error message in editorOn/Off toggle

Device-Specific Settings

SettingDesktopTabletMobile
Font Size✓✓✓
Padding✓✓✓
Margin✓✓✓
Block Gap✓✓✓
Border Width✓✓✓
Border Radius✓✓✓
Icon Size✓✓✓

Tips and Best Practices

Security Guidelines

  • Always Use HTTPS: Ensure your site uses SSL certificates
  • Enable reCAPTCHA: Protect against brute force attacks
  • Strong Password Policy: Encourage strong passwords
  • Limit Login Attempts: Use security plugins to prevent abuse
  • Keep WordPress Updated: Ensure WordPress core and Spectra Pro are up to date

Design Guidelines

  • Clear Visual Hierarchy: Make the submit button stand out
  • Adequate Spacing: Use block gap for better readability
  • Mobile Optimization: Test form on mobile devices
  • Error Visibility: Ensure error messages are clearly visible
  • Accessible Colors: Maintain sufficient color contrast

User Experience Tips

  • Show Password Toggle: Help users verify their password entry
  • Remember Me Option: Provide convenience for trusted devices
  • Clear Error Messages: Help users understand what went wrong
  • Forgot Password Link: Always provide password recovery
  • Registration Link: Make signup accessible if you allow new users

Accessibility Features

Built-in Accessibility

  • Semantic HTML form structure
  • Proper label associations
  • ARIA attributes for screen readers
  • Keyboard navigation support
  • Focus indicators
  • Error message announcements

Keyboard Controls

  • Tab: Navigate forward through form fields
  • Shift + Tab: Navigate backward through form fields
  • Enter: Submit form
  • Space: Toggle checkbox and password visibility

Troubleshooting

Login not working?

  • Verify WordPress login credentials are correct
  • Check for plugin conflicts
  • Ensure form is not cached
  • Verify redirect URLs are valid
  • Check browser console for errors

Styling not applying?

  • Clear browser and server cache
  • Check theme compatibility
  • Use browser inspector for CSS conflicts
  • Verify no custom CSS is overriding

reCAPTCHA not showing?

  • Configure reCAPTCHA keys in Spectra Pro settings
  • Verify reCAPTCHA version matches your keys
  • Ensure site key is for the correct domain
  • Check if browser extensions are blocking it

Redirect not working?

  • Use absolute URLs (include https://)
  • Check redirect URL is accessible
  • Verify redirect option is enabled

Frequently Asked Questions

Q: Can I customize individual form fields? 
A: Yes! Select any child block to customize its specific settings while inheriting parent colors.

Q: How do I change the form width? 
A: Use the “Width” setting in the parent Login Form block settings.

Q: Can I remove the Remember Me checkbox? 
A: Yes, toggle off “Show Remember Me” in the general settings.

Q: Does this work with custom user roles? 
A: Yes, the form uses WordPress authentication and supports all user roles.

Q: Is it compatible with two-factor authentication plugins? 
A: Yes, the form uses standard WordPress login hooks and is compatible with most 2FA plugins.

Q: Can I use multiple login forms on the same page? 
A: Yes, each form gets a unique ID to prevent conflicts.

Q: What happens if someone is already logged in? 
A: You can enable “Logged In Message” to show a message to users who are already authenticated.

Related Documentation

For user registration functionality, see the Register Form Block documentation.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page

Get Notified When Available

Note - You can purchase the Essential Toolkit now and easily upgrade to the Business Toolkit once it becomes available.

Get your hands on Spectra Pro

Enter your name and email address to get access to Spectra Pro.