Pass class to child component
temosis opened this issue · comments
Is there any way to pass class to the label inside <x-form-input>
You should publish the Blade views and then you could use the $attributes
variable inside the form-input
view. You don't have to touch the form-label
view.
Try this in your form:
<x-form-input label-class="text-xl">
And then modify the form-input
view so it passes the label-class
attribute to the form-label
component:
<x-form-label :label="$label" :class="$attributes['label-class'] ?? null" />
That works as intended. I guess i miss understood how component data is shared.