Floating Labels and how to use them in your Joomla website - Copy
Editor's Pick

You may have seen them in form fields: labels that seem to float above the field as you're typing. Can you make those in your Joomla website as well? Yes you can! Brian Teeman explains how. 

What are Floating Labels?

Floating labels are a UI design pattern often used in form fields where the placeholder text for an input field moves or "floats" above the field as the user starts typing. This pattern was popularized by Google’s Material Design guidelines.

How Floating Labels Work:

  • Initial State:
    The label appears as placeholder text inside the input field.
  • Focused State:
    When the user clicks or focuses on the input, the placeholder text animates and moves above the input field.
  • Filled State:
    After the user enters data, the label remains above the input field to provide context for the entered data.

Advantages of Floating Labels

  • Space Efficiency:
    Combines the roles of placeholder text and field labels, reducing clutter and saving space.
  • Improved Usability:
    Ensures context is always available (e.g., users can see what the field represents even after entering data).
  • Enhanced Visual Appeal:
    Adds a polished and modern look to forms.
  • Accessibility:
    Provides a better experience for screen readers and improves usability for visually impaired users, compared to placeholders that disappear on focus. The alternative is to hide the label using CSS and only make it visible to screen readers. (This is what Joomla does with the default login module).

Disadvantages of Floating Labels

  • Cognitive Load:
    Users may initially find the transition distracting, especially if the animation is overly dramatic or not smooth.
  • Complex Implementation:
    Requires creating a Joomla override. Floating labels are not possible with the default Joomla markup for fields. 
  • Reduced Placeholder Functionality:
    Floating labels cannot provide detailed guidance or examples in the placeholder itself (e.g., "e.g., This email address is being protected from spambots. You need JavaScript enabled to view it.").
  • Inconsistent Behaviour:
    If not designed well, users might confuse the floating label with entered data.

Joomla Implementation

The CSS for Bootstrap 5.3 (which is used by the Cassiopeia template) natively supports floating labels you just need to add the required CSS classes and structure the markup in the required order.

Article Show all records of type Article Tutorials
Last Modified: 16 Apr 2025
Hits: 44, Comments: 0, Bookmarked: 0, Followers: 0
0% of 0 votes

Related Records

Joomla 5.2.3 Security & Bugfix Release

Let’s celebrate! The Joomla! Project is pleased to announce the release of Joomla...

Joomla Component Builder

In this series we want to show some tools that can help to build components for Joomla. 

In...

Connecting third-party PHP libraries in Joomla

When developing websites or extensions for Joomla, sometimes tasks arise that have already been...

Floating Labels and how to use them in your Joomla website

You may have seen them in form fields: labels that seem to float above the field as you're typing....

An insight into a Joomler: JoeJoomla

Having been around the JoomlaSphere in some capacity or another for years, what keeps me around and...

The Joy of Road Trips: Adventure on the Open Road

There’s something magical about hitting the open road, leaving behind daily routines, and embracing...

Comments RSS feed Comments

Add New Comment
Access level for this content.