-
-
Notifications
You must be signed in to change notification settings - Fork 668
Open
Description
Problem:
Currently, to set a label above an input field, the title method is used:
Input::make('name')
->title('Your name')However, using title is not entirely correct, as in HTML the title attribute is intended to provide advisory information about the element, not for displaying the main label of the field.
Proposed solution:
Introduce a separate label method for the main field label, keeping title for advisory or helper text. This aligns with practices in Bootstrap, Windows Forms, and other popular UI frameworks:
Input::make('name')
->label('Your name') // Main label above the field
->title('Enter your name here') // Hint or advisory informationBenefits of this separation:
- Correct terminology and semantic meaning.
- Greater flexibility when building interfaces.
Backward compatibility:
To avoid breaking existing code, the title method can remain. If label is not set, its value can be automatically assigned from title. This will preserve the current behavior.
Metadata
Metadata
Assignees
Labels
No labels