F
Filamentβ€’3mo ago
Atreides

How to easily center a label

How can i easily center a label? Without centering it for the hole project, only for one Field in a Form Component? Is there a easy way to center a label? https://filamentphp.com/api/3.x/Filament/Forms/Components/Concerns/HasLabel.html
Solution:
Finally i just removed the label (by using ->label('') ) and added a Placeholder right above the field, with ->content() and added the Titel there. With HtmlString I could position the Title like I wanted
Jump to solution
4 Replies
Atreides
AtreidesOPβ€’3mo ago
Does nobody know a solution?
Solution
Atreides
Atreidesβ€’3mo ago
Finally i just removed the label (by using ->label('') ) and added a Placeholder right above the field, with ->content() and added the Titel there. With HtmlString I could position the Title like I wanted
LeandroFerreira
LeandroFerreiraβ€’3mo ago
You could also do this:
.label-center > div > div {
@apply justify-center;
}
.label-center > div > div {
@apply justify-center;
}
->extraFieldWrapperAttributes(['class' => 'label-center'])
->extraFieldWrapperAttributes(['class' => 'label-center'])
You need to create a custom theme to change this via css..
Atreides
AtreidesOPβ€’3mo ago
@Leandro Ferreira Thanks, very good solution πŸ‘
Want results from more Discord servers?
Add your server