Search 71 components and 72 controllers by name, category or description.
Select
Native select with placeholders, old input, validation and auto-submit
Options and placeholder
:options takes [value => label] pairs. placeholder adds a re-selectable empty first option, so an optional field can go back to having no answer.
{{-- :options takes [value => label] pairs; :selected is merged with old(). --}}
<hw:field name="status" label="Status">
<hw:select
:options="['draft' => 'Draft', 'review' => 'In review', 'published' => 'Published']"
selected="review"
/>
</hw:field>
{{-- placeholder renders a re-selectable empty first option — right for optional fields. --}}
<hw:field name="assignee" label="Assignee">
<hw:select
:options="['ada' => 'Ada Lovelace', 'grace' => 'Grace Hopper', 'alan' => 'Alan Turing']"
placeholder="Unassigned"
/>
</hw:field>
Empty choice
nullable renders an empty option so nothing is pre-selected. Combine it with placeholder when that empty choice deserves a label.
{{-- nullable alone: an empty option with no label, so nothing is pre-selected. --}}
<hw:field name="priority" label="nullable">
<hw:select :options="['low' => 'Low', 'medium' => 'Medium', 'high' => 'High']" :nullable="true" />
</hw:field>
{{-- nullable + placeholder: the empty option gets a label. --}}
<hw:field name="priority_labelled" label="nullable + placeholder">
<hw:select
:options="['low' => 'Low', 'medium' => 'Medium', 'high' => 'High']"
:nullable="true"
placeholder="No priority"
/>
</hw:field>
Multiple
With multiple, :selected takes an array and the name needs [] — without it PHP keeps only the last value. For a searchable multi-value control use hw:multi-select instead.
{{-- The name needs [] or PHP keeps only the last value. placeholder and nullable
do not apply here. For a searchable control, reach for hw:multi-select. --}}
<hw:field name="reviewers[]" label="Reviewers">
<hw:select
:options="['ada' => 'Ada Lovelace', 'grace' => 'Grace Hopper', 'alan' => 'Alan Turing', 'edsger' => 'Edsger Dijkstra']"
:selected="['ada', 'alan']"
multiple
size="4"
/>
</hw:field>
auto-submit
Selects default to immediate submit on change; auto-submit="debounced" opts into a delay. clean-query-params keeps the resulting URL free of empty fields.
every category{{-- Selects submit immediately on change — no debounce to wait out. --}}
<hw:form method="get" :action="route('components.select')" auto-submit clean-query-params frame="select-auto-submit-results">
<hw:field name="category" label="Category">
<hw:select
:options="['design' => 'Design', 'engineering' => 'Engineering', 'ops' => 'Operations']"
:selected="request('category')"
placeholder="Every category"
auto-submit
/>
</hw:field>
</hw:form>
<hw:frame id="select-auto-submit-results" class="mt-4 block rounded-lg border bg-muted/30 p-4 text-sm">
Filtering by: <code>{{ request('category') ?: 'every category' }}</code>
</hw:frame>