x
1
2
3
4
5
<!-- Default --><label class="block mb-2.5 text-sm font-medium text-heading" for="person_first_name">First name</label><!-- With Content --><label class="block mb-2.5 text-sm font-medium text-heading" for="person_first_name">This is not the default label</label>1
2
3
4
5
# Defaultrender(Flowbite::Input::Label.new(attribute: :first_name, form: form))# With Contentrender(Flowbite::Input::Label.new(attribute: :first_name, form: form).with_content("This is not the default label"))Flowbite::Input::Label renders a label for a form input field. It is used
by Flowbite::InputField components, but you can use the component
directly if you need to render a label without an input field.
By default the text of the label is the attribute name unless a
translation is found. This follows the same logic as
ActionView::Helpers::FormBuilder#label.
You can specify the text of the label by rendering the component with a
block or by using #with_content.
No params configured.