Overview
HasHelperElement provides methods for interacting with helper text in Vaadin components. Helper text appears below form fields to provide additional guidance, explanations, or examples to users. It is persistent (unlike tooltips) and complements field labels.
Interface Location: org.vaadin.addons.dramafinder.element.shared.HasHelperElement
Methods
getHelperLocator()
slot="helper".
Returns: Locator - Locator for the first element with slot="helper"
getHelperText()
String - The helper text
assertHelperHasText()
The expected helper text
AssertionError if the helper text does not match
Implementing Classes
The following element classes implementHasHelperElement:
- All text input components (via
HasInputFieldElement) RadioButtonGroupElement- All components that support the helper slot
Usage Example
Implementation Details
Slot-Based Architecture
Vaadin components use slots for extensible content areas. Helper text is placed in thehelper slot:
slot="helper" attribute.
Helper Text Placement
Helper text typically appears:- Below the input field
- Above any error messages
- In a smaller, muted font
- Persistently visible (not on hover/focus like tooltips)
Difference from Error Messages
Helper text is distinct from error messages:- Helper text: Proactive guidance (always visible when set)
- Error messages: Reactive feedback (shown when invalid)
helper vs error-message).
Testing Patterns
Test Guidance Text
Test Format Examples
Test Character Count
Test Field Requirements
Test Dynamic Helper Changes
Best Practices
Use Helper Text for Additional Context
Helper text should provide useful information without repeating the label:Keep Helper Text Concise
Helper text should be brief and scannable:Use for Proactive Guidance
Helper text is for guidance before errors occur:Test Helper Text Visibility
Verify helper text is visible when expected:Common Use Cases
Password Requirements
Optional Field Indication
Format Instructions
Privacy Assurances
Character Limits
Dynamic Feedback
Accessibility Considerations
Helper Text and Screen Readers
Helper text should be associated with the field for screen readers. Vaadin handles this automatically through the helper slot mechanism.Don’t Use for Critical Errors
Critical validation errors should use error messages, not helper text:Supplement, Don’t Replace Labels
Helper text supplements labels but doesn’t replace them:Related Interfaces
- HasLabelElement - Main field label
- HasValidationPropertiesElement - Error messages for validation failures
- HasPlaceholderElement - Placeholder text within the input
- HasTooltipElement - Hover/focus tooltips for additional context
- HasInputFieldElement - Composite interface that includes helper support