x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!-- Include Blank Select -->
<div class="">
<label class="block mb-2.5 text-sm font-medium text-heading" for="person_company">With <code>include_blank: true</code></label>
<select class="bg-neutral-secondary-medium border border-default-medium text-heading rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body px-3 py-2.5 text-sm" name="person[company]" id="person_company"><option value="" label=" "></option>
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option></select>
</div>
<!-- Multiple Select -->
<div class="">
<label class="block mb-2.5 text-sm font-medium text-heading" for="person_company">With <code>multiple: true</code></label>
<input name="person[company][]" type="hidden" value="" autocomplete="off" /><select class="bg-neutral-secondary-medium border border-default-medium text-heading rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body px-3 py-2.5 text-sm" multiple="multiple" name="person[company][]" id="person_company"><option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option></select>
</div>
1
2
3
4
5
# Include Blank Select
render(Flowbite::InputField::Select.new(attribute: :company, form: form, collection: ["Option 1", "Option 2", "Option 3"], include_blank: true, label: {content: "With <code>include_blank: true</code>".html_safe}))
# Multiple Select
render(Flowbite::InputField::Select.new(attribute: :company, form: form, collection: ["Option 1", "Option 2", "Option 3"], multiple: true, label: {content: "With <code>multiple: true</code>".html_safe}))