Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Form SelectField

Luca Longo edited this page Nov 30, 2020 · 3 revisions

Like a <select></select>, but beautiful and flexible.

Properties

name type default value description
id ?string null Field ID (autogenerated if empty)
name ?string null Field name
label ?string null Label visible on the form
errorBag ?string null Error field returned from the bag
disabled bool false Determs if the field is disable (or not)
readOnly bool false Determs if the field is read-only (or not)
value mixed null Field value
placeholder ?string null Field placeholder
hint ?string null Hint text shown above the form component
help ?string null Hint text shown after the form component
options array [] Selectable options
multiple bool false Determs if the select allows multiple selections

Usage

<x-bc-form:select-field label="Select field" error-bag="selectField" value="M" :options="['M' => 'Male', 'F' => 'Female']" />

or, if you use Laravel Livewire:

<x-bc-form:select-field label="Select field" error-bag="selectField" value="M" wire:model="selectField" :options="['M' => 'Male', 'F' => 'Female']" />

Scopes

  • prepend
  • append

Example:

<x-bc-form:select-field>
    <x-slot name="prepend">Prepend</x-slot>
    <x-slot name="append">Append</x-slot>
</x-bc-form:select-field>